Loading ...
Sorry, an error occurred while loading the content.
 

Mapping the NERDTree command

Expand Messages
  • Eric Weir
    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
    Message 1 of 6 , Jun 15, 2014
      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?

      Thanks,
      ------------------------------------------------------------------------------------------
      Eric Weir
      Decatur, GA USA
      eeweir@...

      "...we are a form of invitation to others and to otherness..."

      - David Whyte

      --
      --
      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@....
      For more options, visit https://groups.google.com/d/optout.
    • Eric Christopherson
      ... 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
      Message 2 of 6 , Jun 15, 2014
        On Sun, Jun 15, 2014 at 3:20 AM, Eric Weir <eeweir@...> 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@....
        For more options, visit https://groups.google.com/d/optout.
      • Eric Weir
        ... Apologies, Eric, and thanks. I should ve said i was using MacVim. However, that mapping is not working. ... Eric Weir Decatur, GA USA eeweir@bellsouth.net
        Message 3 of 6 , Jun 16, 2014
          On Jun 15, 2014, at 9:14 PM, Eric Christopherson <echristopherson@...> wrote:

          > here's no way for Vim to recognize Cmd in the terminal. ....
          >
          > Second, your syntax inside the brackets is wrong. For MacVim, you would use
          >
          > map <A-D-n> :NERDTreeToggle<CR>

          Apologies, Eric, and thanks. I should've said i was using MacVim. However, that mapping is not working.

          ------------------------------------------------------------------------------------------
          Eric Weir
          Decatur, GA USA
          eeweir@...

          "Our world is a human world."

          - Hilary Putnam




          --
          --
          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@....
          For more options, visit https://groups.google.com/d/optout.
        • Eric Weir
          ... I gave up and mapped it to n . ... Eric Weir Decatur, GA USA eeweir@bellsouth.net What is man without the beasts? If all the beasts were gone,
          Message 4 of 6 , Jun 16, 2014
            On Jun 16, 2014, at 5:06 AM, Eric Weir <eeweir@...> wrote:

            > On Jun 15, 2014, at 9:14 PM, Eric Christopherson <echristopherson@...> wrote:
            >
            >> here's no way for Vim to recognize Cmd in the terminal. ....
            >>
            >> Second, your syntax inside the brackets is wrong. For MacVim, you would use
            >>
            >> map <A-D-n> :NERDTreeToggle<CR>
            >
            > Apologies, Eric, and thanks. I should've said i was using MacVim. However, that mapping is not working.

            I gave up and mapped it to '<leader>n'.

            ------------------------------------------------------------------------------------------
            Eric Weir
            Decatur, GA USA
            eeweir@...

            "What is man without the beasts? If all the beasts were gone,
            men would die from a great loneliness of spirit."

            - Chief Seattle





            ------------------------------------------------------------------------------------------
            Eric Weir
            Decatur, GA USA
            eeweir@...

            "What is man without the beasts? If all the beasts were gone,
            men would die from a great loneliness of spirit."

            - Chief Seattle



            --
            --
            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@....
            For more options, visit https://groups.google.com/d/optout.
          • Eric Christopherson
            ... Does it do anything? Even make a sound? It worked for me. -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply
            Message 5 of 6 , Jun 16, 2014
              On Mon, Jun 16, 2014 at 05:06:02AM -0400, Eric Weir wrote:
              >
              > On Jun 15, 2014, at 9:14 PM, Eric Christopherson <echristopherson@...> wrote:
              >
              > > here's no way for Vim to recognize Cmd in the terminal. ....
              > >
              > > Second, your syntax inside the brackets is wrong. For MacVim, you would use
              > >
              > > map <A-D-n> :NERDTreeToggle<CR>
              >
              > Apologies, Eric, and thanks. I should've said i was using MacVim. However, that mapping is not working.

              Does it do anything? Even make a sound? It worked for me.

              --
              --
              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@....
              For more options, visit https://groups.google.com/d/optout.
            • Eric Weir
              ... Thanks again, Eric. It beeps. I tried with the same effect. worked, but I went with t. ... Eric Weir Decatur, GA USA
              Message 6 of 6 , Jun 16, 2014
                On Jun 16, 2014, at 8:27 PM, Eric Christopherson <echristopherson@...> wrote:

                > On Mon, Jun 16, 2014 at 05:06:02AM -0400, Eric Weir wrote:
                >>
                >> On Jun 15, 2014, at 9:14 PM, Eric Christopherson <echristopherson@...> wrote:
                >>
                >>> here's no way for Vim to recognize Cmd in the terminal. ....
                >>>
                >>> Second, your syntax inside the brackets is wrong. For MacVim, you would use
                >>>
                >>> map <A-D-n> :NERDTreeToggle<CR>
                >>
                >> Apologies, Eric, and thanks. I should've said i was using MacVim. However, that mapping is not working.
                >
                > Does it do anything? Even make a sound? It worked for me.

                Thanks again, Eric. It beeps. I tried '<C-D-n>' with the same effect. '<C-t>' worked, but I went with <leader>t.

                ------------------------------------------------------------------------------------------
                Eric Weir
                Decatur, GA USA
                eeweir@...

                "...we are a form of invitation to others and to otherness..."

                - David Whyte

                --
                --
                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@....
                For more options, visit https://groups.google.com/d/optout.
              Your message has been successfully submitted and would be delivered to recipients shortly.