News for hackers. Stuff that matters.
Re:Ask HN: Best things in your bash_profile/aliases? by dawnerd on Monday January 14, 2019 @04:00AM (#18901673)
Not strictly an alias, but autojump has been a huge productivity booster for me. Installing it sets up an alias of `j` which guesses the best directory to cd to based on your cd history.

So instead of having to type `cd ~/Projects/someproject` you could just type `j some` and it'll end up there.

https://github.com/wting/autojump

Re:Ask HN: Best things in your bash_profile/aliases? by dflock on Monday January 14, 2019 @04:05PM (#18906458)
There's a static version of this built into bash, btw:

    # allow directory variables
    shopt -s cdable_vars
    
    # set a directory variable
    export some=~/Projects/someproject
You can then say `cd some` from anywhere and end up in `~/Projects/someproject`.
Re:Ask HN: Best things in your bash_profile/aliases? by jciochon on Monday January 14, 2019 @01:35PM (#18905173)
Shoutout as well to the various `warp` implementations[1,2,3]. Instead of guessing, you set "warp points" so for your example you can do something like:

>cd ~/Projects/someproject

>wd add . some

From then on you can use `wd some` to warp to that dir.

[1]: https://github.com/kigster/warp-dir

[2]: https://github.com/mfaerevaag/wd

[3]: https://github.com/troyxmccall/wd

Re:Ask HN: Best things in your bash_profile/aliases? by dawnerd on Monday January 14, 2019 @01:47PM (#18905297)
Oh that's slick! That will be helpful for a few of my similarly named projects that autojump gets wrong sometimes.
Re:Ask HN: Best things in your bash_profile/aliases? by stinos on Monday January 14, 2019 @05:30AM (#18902028)
Such a timesaver indeed. The other one would be fzf [1]. Together they get rid of the endless cd'ing and cursing on the default Ctrl-R for being rather stupid and useless :) And there are powershell counterparts as well (ZLocation and PsFzf).

[1] https://github.com/junegunn/fzf

Re:Ask HN: Best things in your bash_profile/aliases? by itaysk on Monday January 14, 2019 @04:35AM (#18901829)
I've been using z and it's great: https://github.com/rupa/z
Re:Ask HN: Best things in your bash_profile/aliases? by odn86 on Monday January 14, 2019 @08:53AM (#18902901)
Second using z. I couldn't figure out how to get autojump working on windows linux subsystem but z worked perfect right out of the box.
Re:Ask HN: Best things in your bash_profile/aliases? by dividuum on Monday January 14, 2019 @08:47AM (#18902875)
Thanks a lot! Something like that was one of the tiny tools I wrote back on DOS using Borland Pascal (I named it xcd). I figured something like this existed but I never really investigated. autojump is even included in Debian/Ubuntu, so it is trivial to use. I guess putting aside an hour per month to actively apply/install these little tools would be really useful.
Re:Ask HN: Best things in your bash_profile/aliases? by formatkaka on Monday January 14, 2019 @04:21AM (#18901770)
+1. Very useful extension