Vim, Jetbrains or Vscode Vim Mode: A better shortcut to navigate between splits
🤔 Why I wanted to avoid using the default shortcut
I got used to the VIM workflow since 1 year ago. And since I’m a heavy user between panes and the file tree. I wanted to implement a better way to do it. Let’s remember that VIM (or any editor with a mode based on it), brings default shortcuts to accomplish that.
^ + w + ( h or j or k or l) = Move between panels
Windows and Linux users replace the ^ with Ctrl .
But what if we just skip that w ? Since we move between lines with hjkl . Wouldn’t it be easier to add Ctrl or ^ and the direction key to move between panes? I often move between splits in VIM, Neovim, Jetbrains and Vscode. So I wanted to have a unified flow. Here is how I accomplished it.
🛠 Vim & Neovim solution
I put next content in ~/.vimrc or my ~/.config/nvim/init.vim file.
🛠 Vscode solution
It must be edited in the
settings.json file from Vscode. This works if you’re using the
Vim package.
1
"vim.normalModeKeyBindings": [4
"commands": ["workbench.action.navigateUp"]8
"commands": ["workbench.action.navigateDown"]12
"commands": ["workbench.action.navigateLeft"]16
"commands": ["workbench.action.navigateRight"]
🛠 Jetbrains solution
Remember to install
Ideavim. This will look any config into your
~/.ideavimrc
▶️ Testing it
To make it work, restart any of your editors. Now you should be able to move quickly between panes.