How to increment in vim under windows (where CTRL-A does not work…)

后端 未结 7 2200
不知归路
不知归路 2020-12-08 15:32

While CtrlX works fine in vim under windows, CtrlA selects all (duh).

Is there a way to increment a number with a keystro

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 15:47

    I realize that this is an old question, but I ran across another option today based on the following question. Making gvim act like it does on linux will allow CTRL-A to work as you expect it to:

    how to make gvim on windows behave exacly like linux console vim?

    There is a section of the _vimrc that has the following items. These cause many of the control characters to act like they do on Windows.

    set nocompatible
    source $VIMRUNTIME/vimrc_example.vim
    source $VIMRUNTIME/mswin.vim
    behave mswin
    

    I commented out (with ") the mswin lines and the set nocompatible line. From there, I added set compatible. This causes gvim to act like it does on linux. Thus, mine looks something like:

    set compatible
    source $VIMRUNTIME/vimrc_example.vim
    "set nocompatible
    "source $VIMRUNTIME/mswin.vim
    "behave mswin
    

    I just learned this trick today, so if I'm not completely correct in my information, please let me know.

提交回复
热议问题