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

Re: mapping broken

Expand Messages
  • Ben Schmidt
    ... explains them. ... Yes. .vimrc is always used. .gvimrc is used in addition when the GUI is started. More (much) more info, you can check out ... To handle
    Message 1 of 17 , Feb 4, 2008
      >> map <C-@> <Esc>
      >> map! <C-@> <Esc>

      :map is for normal mode, visual mode, some others.
      :map! is for insert mode, commandline mode, some others.

      :help map-modes

      explains them.

      > Whoops, I may have spoken too soon when I said this works. It appears to work for console vim, but it threw MacVim off kilter. It used to work in MacVim but not console, and now it's the reverse. <C-Space> does what <C-@> really does, paste last inserted, despite my mapping <C-@> to <Esc> in the .vimrc.
      >
      > First I thought maybe I have to do it in .gvimrc too, but clearly MacVim picks up on my mappings in .vimrc.

      Yes. .vimrc is always used. .gvimrc is used in addition when the GUI is started.
      More (much) more info, you can check out

      :help vimrc
      :help gvimrc

      To handle both cases, maybe you need to do something a bit more fancy in your
      .vimrc like

      if has('gui_running')
      map <C-Space> <Esc>
      map! <C-Space> <Esc>
      else
      map <C-@> <Esc>
      map! <C-@> <Esc>
      endif

      Or leave the .vimrc like you had it, but unmap and map again in your .gvimrc:

      unmap <C-@>
      unmap! <C-@>
      map <C-Space> <Esc>
      map! <C-Space> <Esc>

      Ben.



      Send instant messages to your online friends http://au.messenger.yahoo.com


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.