Deos somebody know a good/neat way to create shortcuts to directories in Vim?

Akin to the "~[short_cut]" in zsh where you can use it to quickly specify a directory you use.

I could create aliases in my home directory and use "~/[alias]" but it would be nice if I could have something only available in Vim.

link|improve this question
feedback

5 Answers

up vote 1 down vote accepted

You can use cmdalias for Vim. Then you can make custom aliases such as cdsrc to change to a directory like /home/user/project/source.

link|improve this answer
feedback

There is a FavEx plugin: http://www.vim.org/scripts/script.php?script_id=539

link|improve this answer
feedback

NerdTree provides bookmarks handling. See ":h NerdTreeBookmarks".

While not directly accessible via ":cd", there is at least ":NERDTreeFromBookmark", where you can then "cd" to this (or another dir).

Also "B" in the NERDTree window will toggle display of bookmarks, and allows to easily access them.

link|improve this answer
NerdTree looks awesome. Thanks! – Daisuke Shimamoto Dec 13 '11 at 7:15
feedback

Something like

let $vimfiles = "c:\\ldigas-home\\gvim72\\vim\\vimfiles"

so when I go

 cd $vimfiles  

it puts me in

c:\ldigas-home\gvim72\\vim\vimfiles

Or did you have something else in mind ?

link|improve this answer
feedback

One way I solved this was by having something like this:

nnoremap <silent> <leader>hd :e ~/daisuke

in my .vimrc. This will populate the command with ":e ~/daisuke" with the cursor at the end. This actually suites me well as majority of the time, I want to edit a file under that directory not necessarily just cd to it (sorry should have been more clear about this!)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.