3 ms·
I think I might be able to help with this one! Here's a little trick I learned from a friend. It's also tab completable. I keep all my code in ~/code $ c
by gpspake 6y ago
I think I might be able to help with this one! Here's a little trick I learned from a friend. It's also tab completable.
I keep all my code in ~/code
$ c # cd to ~code
$ c pr<tab> # tab complete to c projectname
$ c projectname # cd to ~/code/projectname
This is pretty simple in zsh
# c to cd to ~/code
c() { cd ${CODE_DIRECTORY}/$1; }
# tab complete c against code
_c() { _files -W ${CODE_DIRECTORY} -/; }
compdef _c c
(Note: CODE_DIRECTORY is just an env var for ~/code)
I use this all the time and I use h to do the same for my home directory
https://github.com/gpspake/dotfiles/blob/master/zsh/gpspake/gpspake.plugin.zsh#L40 https://github.com/gpspake/dotfiles/blob/master/zsh/gpspake/...