Is there a way to increase the number under the coursor while still using behave mswin
? Since behave mswin
overwrites CTRL_A
1 Answer
In itself, :behave mswin
does not remap <C-A>
. But there is a script mentioned in :help behave
- called mswin.vim
- which calls :behave mswin
and remaps Ctrl+A etc.
For clarifications which mappings and settings are applied by mswin.vim
, open and read the file in your favorite editor. I suggest :e $VIMRUNTIME/mswin.vim
.
Minimal
Just call :behave mswin
but don't :source $VIMRUNTIME/mswin.vim
.
This will give :behave mswin
but not map any other keys.
Unmap
Source the file but unmap everything that's not wanted. It would look like this in vimrc:
source $VIMRUNTIME/mswin.vim
unmap <C-A>
unmap <C-X>
Figuring out how much sense it makes to source a file that defines mappings only to unmap them later is left as an exercise to the reader.
Other mapping
To have both Ctrl+A select everything and have a key to increment numbers, you can assign a different mapping to the latter function.
It would look like this in vimrc:
source $VIMRUNTIME/mswin.vim
nnoremap <leader>a <C-A>
In this example, it will make leader+A increment numbers while retaining Ctrl+A to select all. The best of both worlds, if you will.