1

In Vim the commands <C-o> and <C-i> move backwards and forwards through the jump list.

:h CTRL-I 

I noticed that <Tab> is the alternative command you can use instead of <C-i> and this leads me to my question...

I have the following mapping defined in my .vimrc:

nnoremap <Tab> gt

It works fine, in that if I press <Tab> and there are tabs open, it will iterate through the list of tabs.

But I then noticed that <C-i> stops working and instead is mapped to my new mapping behaviour...

:verbose map <C-i>

...would show the line in my .vimrc where I had defined the updated Tab mapping.

How can I prevent <C-i> from being remapped to where I'm now mapping Tab to?

I already use nnoremap so <Tab> doesn't get expanded back to the original <C-i> jump list behaviour, and so I'm not sure how to prevent that with <C-i> unless I try maybe doing something weird like nnoremap <C-i> <C-i> (which doesn't work btw as I tried it).

Note: if I comment out my new map nnoremap <Tab> gt and restart Vim the <C-i> behaviour goes back to normal, and there's no longer a mapping against it (e.g. :verbose map <C-i> returns nothing).

3
  • 2
    Tab is a synonym of C-i. They produce the same escape sequence for terminals afair.
    – Maxim Kim
    Aug 21 '19 at 8:42
  • Have a look at an ascii table. CTRL-I is the same as <Tab>. Aug 21 '19 at 9:04
  • 1
    Closing as a duplicate because we have a lot of similar question ex 1, ex 2, ex 3, ex 4 and I tried to make something more generic here
    – statox
    Aug 21 '19 at 9:17

Browse other questions tagged or ask your own question.