Disable for good VIM's number increment that is mapped to Ctrl-a

元气小坏坏 提交于 2019-12-01 00:10:03

Why it doesn't work

Ctrl is not a vim-recognized <> notation to represent a keyboard's Control key.

Recommendation

To disable Control-a triggering default vim auto-increment on a number:

  1. In your ~/.vimrc, as @Marth said, use <C-a>:

    map <C-a> <Nop>
    
  2. Save :w

  3. :so ~/.vimrc for it to take effect.

Warranty

  • Tested to work in Vim 7.4
  • You don't need to disable Ctrl-q in Vim

Explanation

  • Don't need to disable Ctrl-q within Vim, since your Tmux is never sending Ctrl-q,
  • Your posted tmux.conf is sending prefix, which you define as Ctrl-a, so Vim is only receiving Ctrl-a

Thus you successfully disable the auto-increment when you map Control-a to the do-nothing instruction <Nop>

Further reading

  • Vim, :help <>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!