Re:Z - Jump to directories that you actually use.
by 4ad on Sunday September 02, 2012 @06:10AM
(#4466687)
No tricks, just regular cd:
% pwd
/home/aram
% cd mstate
/home/aram/src/launchpad.net/juju-core/mstate
% cd go/src
/home/aram/go/src
% cd plan9
/home/aram/plan9
%
It uses the $CDPATH environment variable ($cdpath in rc(1)). $CDPATH is a list of places in which to search for the wanted directory. I put all the things I regularly use there, and my cds are almost always short, usually just a single name.
I don't maintain $CDPATH myself, my profile runs a one liner that descends into certain directories and constructs $CDPATH for me within the constrains of some rules (for example excludes leafs, excludes {bin,doc,pkg,test}, etc).
Finding about $CDPATH was a huge productivity boost to me, not only in time saved typing, but in allowing me to change the way I work. I now rarely care where things in the filesystem are (e.g. various source code for various software, where the build products are, etc). I used to do a lot of moving and symlinking around, to arrange stuff so I remember where I've put it and to keep paths short, but now I don't care. It could be wherever, it's just one name away. The namespace had become a big hash.
Re:Z - Jump to directories that you actually use.
by wting on Sunday September 02, 2012 @10:20AM
(#4467061)
This is a pretty good solution, however there are a few things other programs add on:
- $CDPATH requires manual management. You're using a line in profile, but I imagine that's limited to specific directories and creates overhead when creating new shells.
- What happens with namespace collision? First entry in $CDPATH wins?
- Fuzzy searching for mistyped directory names. I don't find this feature that useful personally, but was requested quite a bit by others.
Re:Z - Jump to directories that you actually use.
by 4ad on Sunday September 02, 2012 @08:12AM
(#4466837)
Rc(1) is the Unix v10/Plan 9 shell[1] written by Tom Duff[2], of Duff's device[3] fame. Rc(1) is of course available in Unix as well, I use the port from plan9port[4].
Re:Z - Jump to directories that you actually use.
by shawndumas on Saturday September 01, 2012 @02:21PM
(#4464583)
CDPATH, as desribed in man bash
'The search path for the cd command. This is a colon-separated list of directories in which the shell looks for destination directories specified by the cd command. A sample value is ".:~:/usr".'
Re:Z - Jump to directories that you actually use.
by olalonde on Saturday September 01, 2012 @11:44PM
(#4466054)
In case anyone else is wondering what "frecency" is:
Frecency is a portmantaeu of ’recent’ and ’frequency’. It is a weighted rank that depends on how often and how recently something occured. As far as I know, Mozilla came up with the term.
Thanks a million! :D
I don't maintain $CDPATH myself, my profile runs a one liner that descends into certain directories and constructs $CDPATH for me within the constrains of some rules (for example excludes leafs, excludes {bin,doc,pkg,test}, etc).
Finding about $CDPATH was a huge productivity boost to me, not only in time saved typing, but in allowing me to change the way I work. I now rarely care where things in the filesystem are (e.g. various source code for various software, where the build products are, etc). I used to do a lot of moving and symlinking around, to arrange stuff so I remember where I've put it and to keep paths short, but now I don't care. It could be wherever, it's just one name away. The namespace had become a big hash.
- $CDPATH requires manual management. You're using a line in profile, but I imagine that's limited to specific directories and creates overhead when creating new shells. - What happens with namespace collision? First entry in $CDPATH wins? - Fuzzy searching for mistyped directory names. I don't find this feature that useful personally, but was requested quite a bit by others.
William (autojump maintainer)
[1] http://doc.cat-v.org/plan_9/4th_edition/papers/rc
[2] http://en.wikipedia.org/wiki/Tom_Duff
[3] http://en.wikipedia.org/wiki/Duff%27s_device
[4] http://swtch.com/plan9port/
Tools like Z and autojump are fantastic timesavers.
https://github.com/rupa/v
'The search path for the cd command. This is a colon-separated list of directories in which the shell looks for destination directories specified by the cd command. A sample value is ".:~:/usr".'
Frecency is a portmantaeu of ’recent’ and ’frequency’. It is a weighted rank that depends on how often and how recently something occured. As far as I know, Mozilla came up with the term.
https://github.com/mxcl/homebrew/pull/14621
https://gist.github.com/1119556
I also set .bash_profile aliases to quickly cd up the directory tree with just dots. It's silly, but surprising helpful.
PS: The whole story on my blog https://chanux.wordpress.com/2012/08/09/no-more-cd-dot-dot-s...