0

How do I get the increment by 1 behavior in MacVim for Command-A? <C-A> increments as excpected. In windows I just have to unmap <C-A>, so in MacVim I've tried the following:

" 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>

I've looked at the following, but I still can't figure it out:

how to map command key when configurate .vimrc?

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

xdhmoore
  • 8,935
  • 11
  • 47
  • 90

1 Answers1

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>
    
romainl
  • 186,200
  • 21
  • 280
  • 313
  • That did the trick. I had made the false assumption that putting things in the `.gvimrc` was just a convention and didn't make a difference. That's what I get for assuming. Thanks for your help. – xdhmoore Feb 05 '18 at 16:23