DEV Community

Discussion on: Bring Your Vim/Tmux Navigation Reflexes to VS Code

Collapse
 
bdannowitzhudl profile image
BDannowitzHudl

I know this post is a bit old, but I put these settings in all my VS Code configurations. One thing that I have an issue with is getting this kind of navigation to work from within .ipynb notebooks.

I've found that this works for left and right navigation:

    {
        "key": "ctrl+h",
        "command": "workbench.action.focusLeftGroup",
        "when": "notebookEditorFocused"
    },
    {
        "key": "ctrl+l",
        "command": "workbench.action.focusRightGroup",
        "when": "notebookEditorFocused"
    }
Enter fullscreen mode Exit fullscreen mode

but there is no such action for focusUpGroup/focusDownGroup, and I can't quite get this work work with navigateUp/navigateDown or panels.

Do you have any immediate insights as to how to accomplish this? Thanks for the great post!

Collapse
 
ajkerrigan profile image
AJ Kerrigan

I don't use notebooks in VS Code much so I didn't have any immediate insights, but your comment got me curious so I went looking for some :D. And the first place I landed was this open issue which you already commented on!

github.com/microsoft/vscode/issues...

I replied to your comment there, but you can add focusAboveGroup and focusBelowGroup bindings to make the workaround cover all directions:

    {
        "key": "ctrl+k ctrl+h",
        "command": "workbench.action.focusLeftGroup",
        "when": "notebookEditorFocused"
    },
    {
        "key": "ctrl+k ctrl+l",
        "command": "workbench.action.focusRightGroup",
        "when": "notebookEditorFocused"
    },
    {
        "key": "ctrl+k ctrl+j",
        "command": "workbench.action.focusBelowGroup",
        "when": "notebookEditorFocused"
    },
    {
        "key": "ctrl+k ctrl+k",
        "command": "workbench.action.focusAboveGroup",
        "when": "notebookEditorFocused"
    }
Enter fullscreen mode Exit fullscreen mode

(At some point after writing this post, I moved my nav bindings into chords off ctrl+k only because I kept running into edge cases where I wanted ctrl+k available.)