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

Re: Open a new file if the file doesn't exist when using ctrl+W_ctrl+F?

Expand Messages
  • Benjamin R. Haskell
    ... As pointed out in :h , the let mapleader must be done before the mapping is defined. If a.vim is in your .vim/plugin/ directory, it might be
    Message 1 of 9 , Feb 27, 2010
    • 0 Attachment
      On Thu, 25 Feb 2010, Peng Yu wrote:

      > On Feb 25, 12:58 am, "Christian Brabandt" <cbli...@...> wrote:
      > > On Thu, February 25, 2010 3:33 am, Peng  Yu wrote:
      > > > I see the following line on the above page. But I'm not sure what
      > > > '<Leader>' represents here. Would you please let me know?
      > >
      > > > <Leader>is switches to the alternate file of file under cursor
      > > > (e.g. on  <foo.h> switches to foo.cpp)
      > >
      > > :h <Leader>
      >
      > I typed "\is" in the "ESC" mode. Instead of switching to foo.cpp, vim
      > enters edit mode.

      Perhaps '\', '\i', or '\is' is mapped to something else. Try:

      :map \
      :map \i
      :map \is

      Before trying out 'a.vim', for example, I also had:

      :map \i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>

      > I try to let mapleader =",", then type ",is" in the
      > ESC mode, vim still enters edit mode. What is wrong with my
      > operations?

      As pointed out in :h <Leader>, the 'let mapleader' must be done before
      the mapping is defined. If 'a.vim' is in your .vim/plugin/ directory,
      it might be sourced before your 'let mapleader' was. If you want to
      change it, you should have it somewhere in your .vimrc.

      It might also be the case that something else is setting mapleader.
      Look in the output of ':map' for what is mapped to :IHS<CR>, e.g. in
      mine, without setting mapleader, I have:

      :map
      [...]
      n \ihn :IHN<CR>
      n \is :IHS<CR>:A<CR>
      n \ih :IHS<CR>

      --
      Best,
      Ben

      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.