3
1 Comment

VIM developers around? Trying to set custom imap

Hey everyone
I'm trying to set a custom imap so when I click ctrl + 1 and ctrl + 2, it changes buffers back and forth (instead of using ctrl+i and ctrl+o)

Any ideas how to achieve this?

on March 17, 2020
  1. 3

    Hi Ran,

    The lines you would add to your vimrc are below, but will most likely not work. Based on a SO search I did, trying to use ctrl and a number together may not work for reasons mentioned in the first response post. Maybe use ctrl+q, and ctrl+w instead?
    https://vi.stackexchange.com/questions/22145/how-to-map-ctrl

    imap <C-1> <esc>:bn<cr>i
    imap <C-2> <esc>:bp<cr>i

    Hope this helps.

    James