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

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

    A similar problem occurs under GNU/Linux when using Vim with mswin.vim. Remapping Alt+X to Ctrl+A prior to evoking mswin.vim solved my issue.

    execute "set =\ex"
    noremap  
    source $VIMRUNTIME/mswin.vim
    behave mswin
    

    Now, Alt+X and Ctrl+X respectively increase and decrease numbers in Vim.

    Mapping to Alt key combinations is often not evident in Vim; read more about this here.

提交回复
热议问题