1

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?

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')
| improve this answer | |

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.