Sunday, June 15, 2014

Re: Mapping the NERDTree command

On Sun, Jun 15, 2014 at 3:20 AM, Eric Weir <eeweir@bellsouth.net> wrote:
>
> I want to map the NERDTree command to the option-command-n key combination on a Mac keyboard.
>
> I have this in my .vimrc: map <Option-Command-n> :NERDTreeToggle<CR>
>
> It's not working. What am I doing wrong?

First, that will only work if you're in the MacVim GUI. There's no way
for Vim to recognize Cmd in the terminal. However, at least with
iTerm2, it would be possible to configure the terminal to send a
specific character sequence when you hit that combination of keys;
then you could use that character sequence in a mapping.

Second, your syntax inside the brackets is wrong. For MacVim, you would use

map <A-D-n> :NERDTreeToggle<CR>

<A-...> means alt, which correlates with Opt on a Mac (I believe
<M-...> for "meta" would work too). <D-...> is a MacVim-specific thing
which means the Cmd key. (I'm not sure why "D-"; maybe because it's
the last letter of "command", the first letter already having been
used?)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment