如何在MacVim中将<d-a>映射到增量1

时间:2018-02-02 18:54:06

标签: vim macvim

如何在MacVim for Command-A中获得1行为增量? <C-A>按照预期的增量递增。在Windows中我只需取消映射<C-A>,所以在MacVim中我尝试了以下内容:

" Doesn't seem to work. <D-A> still selects all
macmenu Edit.Select\ All key=<Nop>
nnoremap <D-A> <C-A>

_

" Doesn't work, no mapping exists
nunmap <D-A>

我看过以下内容,但我仍然无法弄明白:

how to map command key when configurate .vimrc?

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

1 个答案:

答案 0 :(得分:1)

As explained in :help :macmenu,

  • you must do that in ~/.gvimrc,
  • <D-..> mappings are case sensitive so <D-A> is not the same as <D-a>.

So, in order to use <D-a> in place of <C-a>:

  1. Create ~/.gvimrc if it doesn't exist.

  2. Add the following lines:

    macmenu Edit.Select\ All key=<nop>
    nnoremap <D-a> <C-a>