sponsor Vim development Vim logo Vim Book Ad

CD.vim : CD to whatever directory the current buffer is using.

 script karma  Rating 185/87, Downloaded by 7621  Comments, bugs, improvements  Vim wiki

created by
Rich Harkins
script type
This is a tiny little script to allow the VIM user to CD to whatever directory your buffer currently is in.  So, if you "vim my/dir/deeply/in/src/file.txt" a lot then ":CD" will move VIM into my/dir/deeply/in/src so that you can edit other files easily within the same directory.
install details
Either copy the guts of the file into your .vimrc or source it.

Share and enjoy!

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cd.vim 2.1 2002-06-17 6.0 vipin aravind useful when changing directories when buffers are switched.
CD.vim 2.0 2002-01-03 5.7 Gergely Kontra Simplified. I'm not sure it works under vim 5.7
CD.vim 1.1 2001-10-03 5.7 Rich Harkins Added support for backslash separated filenames.  Thanks to Kontra Gergely for pointing this flaw out.
CD.vim 1.000001:) 2001-08-20 5.7 Rich Harkins Sorry - missed the com command off my posting!!!
CD.vim 1.0 2001-08-20 5.7 Rich Harkins Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.