Is there any way to map same command to multiple key without repeating mapping. Like mapping this one
inoremap ) <right> inoremap " <right> inoremap ] <right>
into something like this.
inoremap ) <or> " <or> ] <right>
Is it possible?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
It isn't possible unfortunately, but if it's something you tend to do often, you can write a function to do it for you:
function! CustomMap(commands, rhs, type) for l:command in a:commands sil!exe a:type."map ".l:command." ".a:rhs endfor endfunction call CustomMap([')', '"', ']'], '<right>', 'inore')