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

RE: cd'ing to the directory of the file

Expand Messages
  • Scott Johnston
    I also looted the following from Douglas vimrc when I first starting using vim: if has( unix ) map ,e :e =expand( %:p:h ) . / else map ,e :e
    Message 1 of 4 , Mar 27, 2001
    • 0 Attachment
      RE: cd'ing to the directory of the file

      I also looted the following from Douglas'
      vimrc when I first starting using vim:

      if has("unix")
      map ,e :e <C-R>=expand("%:p:h") . "/" <CR>
      else
      map ,e :e <C-R>=expand("%:p:h") . "\\" <CR>
      endif

      This allows you to quickly edit a file in
      the same directory as the file you are viewing without
      the cd step.

      http://vim-tips.sourceforge.net/tip.php?TIP_ID=2

      sj

      -----Original Message-----
      From: brown@... [mailto:brown@...]
      Sent: Tuesday, March 20, 2001 10:22 AM
      To: vim@...
      Subject: cd'ing to the directory of the file


      Is there a way to 'cd' to the directory that the current file is from.

      Frequently I will load a file that is from another directory.  After awhile
      I have a set of files using :ls and :b to jump back and forth
      with.  Sometimes I would like to read another file from the same directory
      as the file I am working on, which is not necessarily the one I am in.

      Thanx


      Julian L. Brown         |while (1) { julian.WakeUp ();
      Programmer++            |if (sunday) julian.GotoChurch();
      System Development Inc. |julian.WritePrograms(); julian.FamilyLife();
      Houston, U.S.A.         |julian.Sleep();  }

    Your message has been successfully submitted and would be delivered to recipients shortly.