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

后端 未结 7 2205
不知归路
不知归路 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:46

    You can make CtrlA to increment in windows by opening up the 'mswin.vim' file in your vim directory and finding the section that looks like:

    " CTRL-A is Select all
    noremap  gggHG
    inoremap  gggHG
    cnoremap  gggHG
    onoremap  gggHG
    snoremap  gggHG
    xnoremap  ggVG
    

    Comment out all of these lines as follows:

    " CTRL-A is Select all
    "noremap  gggHG
    "inoremap  gggHG
    "cnoremap  gggHG
    "onoremap  gggHG
    "snoremap  gggHG
    "xnoremap  ggVG
    

    and the CtrlA keystroke will increment.

    This is a pretty nice option when your keyboard doesn't have a real number pad.

提交回复
热议问题