19

Jump with CtrlI doesn't work in my Vim, but CtrlO works.

It's weird, verbose map <c-i> or verbose map <c-I> shows below:

s  <Tab>         <Plug>snipMateNextOrTrigger
    Last set from ~/.vim/bundle/vim-snipmate/after/plugin/snipMate.vim
x  <Tab>         >gv
    Last set from ~/.vim/plugin/settings/Settings.vim
n  <Tab>         v>
    Last set from ~/.vim/plugin/settings/Settings.vim

When I press CtrlI, the current line will be indented, and vim goes to Visual Mode.

I tried to add unmap <c-i> to ~/.gvimrc, but it failed, when macvim starts

Error detected while processing /Users/dfang/.vimrc:
line   83:
E31: No such mapping

How can I get back my CtrlI, and how can I remap CtrlO to Ctrl- (left from = key) ?

Xavier T.
  • 40,509
  • 10
  • 68
  • 97
dfang
  • 1,366
  • 15
  • 41

3 Answers3

39
  1. <C-i> and <Tab> are strictly equivalent.

  2. You are actively overriding <Tab> and therefore <C-i> in ~/.vim/plugin/settings/Settings.vim.

  3. If you want <C-i> to work normally don't override it (or <Tab>). Simple.

  4. Unless you have a very specific reason to do so, you don't need to put anything in ~/.gvimrc.

  5. The normal place for your settings/mappings is ~/.vimrc, there's no valid reason to put them anywhere else (~/.vim/plugin/settings/Settings.vim or wherever).

  6. Use nnoremap <C-+> <C-o> if you want <C-+> to do what <C-o> does, whatever benefit you think you will get from doing that.

romainl
  • 186,200
  • 21
  • 280
  • 313
4

Ye snipmate is adding the mapping.

Thanks @dfang. Based on your question

I tried to add unmap <c-i> to ~/.gvimrc, but it failed, when macvim starts

I tried to use <C-i> instead and it worked!

Petur Subev
  • 19,983
  • 3
  • 52
  • 68
0

An alternative is to press Ctrl-Shift-i (also Ctrl-Shift-o) instead.

Older keyboards did not have the TAB key so Ctrl-I was used for that purpose, but for vim, it seems we can take advantage of this:

Ctrl-i == TAB
Ctrl-Shift-i != Shift-TAB
Tsan-Kuang Lee
  • 1,454
  • 1
  • 14
  • 10