2

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

3

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')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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