0

Is there a way to increase the number under the coursor while still using behave mswin? Since behave mswin overwrites CTRL_A

0

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.