Reputation: 31
I use the Colemak DH mod layout, which moves around the default keys used for navigation in normal mode. I was wondering if there was any way to remap the hjkl cursor key combo to mnei, or better yet, neio. I am not actually using vim, but rather using the VIM extension for vscode. I've been looking around the internet, but I couldn't find anything.
Upvotes: 3
Views: 2463
Reputation: 380
I know of two ways of doing so:
That's what I'm currently using. I have the following settings in the VSCode config, that make VIM plugin to load the specified vimrc file
"vim.vimrc.enable": true,
"vim.vimrc.path": "$HOME/.vim/vimrc_vscode",
And then in vimrc_vscode
:
nnoremap j h
nnoremap k j
nnoremap h k
vnoremap j h
vnoremap k j
vnoremap h k
You can use the "non recursive" remapping setting to swap the keys the way you want.
Example (swap j
and k
):
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["j"],
"after": ["k"]
},
{
"before": ["k"],
"after": ["j"]
}
]
Upvotes: 4