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?

1 Answer 1


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

call CustomMap([')', '"', ']'], '<right>', 'inore')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.