I know that I can use ctrl+w to shift between different Vim windows. But how do I remap the CMD-key to replace ctrl+w in various way? I'm specifically looking to bind cmd with the arrow keys, so that I can shift to NERDTree easily with CMD+LeftArrow. Appreciate the assistance.
I've tried to add the following to $MYVIMRC...
nmap <silent> <D-h> :wincmd h<CR> // For going to NERDTree
nmap <silent> <D-l> :wincmd l<CR> // For going back to file I'm working on.
In the left-hand side of a mapping,
Command+Leftis written<D-Left>. With this and other issues fixed (see below), your mappings should look like this:or, simply, like this:
Other issues:
nmap) should be reserved to the rare situations where you want to use another mapping in your mapping. This is not the case, here, sonnoremapis the best choice.<silent>is useless.", not//.:help map-comments.:help <Cmd>is cleaner than using:in the right-hand side of a mapping.Note that these mappings only work in the MacVim GUI.