DEV Community

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

Collapse
 
ajkerrigan profile image
AJ Kerrigan • Edited

Hi Alex, that seems like a handy binding :). At first I thought the easiest way to handle that would be inside ~/.vimrc, coupled with the "Use key mappings from .vimrc" setting. That worked for split but not vsplit in my setup. That could be an issue just on my end, I've messed with my settings a bunch since this post!

That said, handling it from the VS Code side worked fine for me. The VSCodeVim extension lets you define mode-level overrides, so a block like this in your settings.json should do the trick:

"vim.normalModeKeyBindings": [
    {
        "before": ["<leader>", "|"],
        "commands": [
            "workbench.action.splitEditorRight"
        ]
    },
    {
        "before": ["<leader>", "-"],
        "commands": [
            "workbench.action.splitEditorDown"
        ]
    }
]
Enter fullscreen mode Exit fullscreen mode