What does HackerNews think of autojump?
A cd command that learns - easily navigate directories from the command line
I have seen other people suggesting https://github.com/wting/autojump too, so it might be worth giving that tool a look, it seems supported a bit better and more actively developed.
- Combine it with autojump[1] and quickly navigate to any directory you've navigated to before (sorted by frequency). This is crazy helpful.
- Use it for git branch names
- Use it for ssh locations
https://github.com/wting/autojump
It allows you to quickly navigate your filesystem via the shell by learning the directories you commonly visit/have visited.
For exploring massive file trees, a terminal file manager that allows you to preview the contents of subdirectories without entering them is huge time saver. I use `lf`.
A very simplified example: if you call `j pro`, the command should take you to the folder that best matches the name based on some criteria (in my case, one of them would be frecency). In my case, that would be my projects folder in another drive.
The nifty thing about them is that you don't have to make those aliases manually -- the tool learns the directories you've visited over time.
Of course, the tool could take you to the wrong path, but with a well made set of matching/prioritization rules, I've found it more useful than not.
Agree that it's an invaluable piece of software!
> autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line.
Since I also love ranger as a file manager, I wrote my own integration of both: https://github.com/fdw/ranger-autojump . It remembers where I went in ranger, and I can also call autojump in ranger.
ctrl+r (reverse search) on steroids: fzf (https://github.com/junegunn/fzf)
put a symlink to my dot files to a dropbox folder (always backed up .bash_profile or whatnot)
ssh tunnel to expose a port from a remote server on my computer: ssh -L 8500:localhost:8500 $remotehost
expose a port on my machine to the internet (demos and such): https://ngrok.com/
git bash prompt and git completion: know at a glance the branch I'm on and if there is un-staged/un-committed code. Allow tab complete for remotes and branch names. Lots of options here.
autojump (https://github.com/wting/autojump): `j foo` will jump directories to my /whatever/foo directory. Better than popd and pushd.
And before I had it baked into my prompt: `echo $?` to show the exit code of my last command.
Others you might want to checkout not necessarily for writing a book but general CLI pleasantness:
- fzf (https://github.com/junegunn/fzf)
- autojump (https://github.com/wting/autojump)
So instead of having to type `cd ~/Projects/someproject` you could just type `j some` and it'll end up there.
It is a bit similar to z, I actually looked a bit at autojump (https://github.com/wting/autojump) before working on goto, which is quite similar to z. Z keeps track of where you have been and guesses where you want to go (I haven't tried it, but it probably is good). Goto works more like bookmarking where you can bookmark a single location and then later jump to it. I guess I would say goto and z solve the same problem but goto doesn't guess where you want to go, instead you have to enter the folders you want to use manually.
The reason I developed goto was to use profiles. Sometimes I want a certain set of locations to jump (and autocomplete) to. And other times I want a different set of locations to jump to. Profiles in goto solve this by allowing you to switch between them.
Autojump makes it easy to quickly jump into any directory I've visited and then I can open my editor or Finder (file explorer) from there. Would be great if I can be inside nnn and jump to directories using autojump.
fd is very useful when I want to just directly open a file. I might be in a project's root directory and I'd want to edit a file a few levels nested. Currently I either use fd to locate the path of the file, and then copy paste it into the shell. If `fd` is combined with nnn, I can type in a few letters of the file I expect, and jump to its parent directory, with the file highlighted.
Is this workflow possible in nnn, or can it be written using its scripting?
Here my personal setting:
- Email : mutt [http://www.mutt.org/]
- Passwords manager : pass [https://www.passwordstore.org/]
- Navigate directories : autojump [https://github.com/wting/autojump]
- Task manager : task [https://taskwarrior.org/]
- Music : cmus [https://cmus.github.io/]
- Text editor : emacs -nw [https://www.gnu.org/software/emacs/]
https://github.com/wting/autojump
I also use `loop`, my own Rust-based replacement to bash's native loops:
Alfred
I like http://www.alfredapp.com. Gives you immediate access to lots of tools and you can install custom workflows. A few favorites:
sublime workflow - https://github.com/franzheidl/alfred-workflows/tree/master/o... - Useful for opening folders or files in sublime.
git repos - https://github.com/deanishe/alfred-repos - Search local repos in alfred
font-awesome search https://github.com/ruedap/alfred-font-awesome-workflow - Retrieve css for fontawesome.com icons.
HN - https://github.com/wkgg/hackerNews-alfred-workflow Shows hacker news in Alfred.
I've also written a couple workflows. There is a really nice python library: https://github.com/deanishe/alfred-workflow that makes it easy.
gist-alfred - https://github.com/danielecook/gist-alfred - Search and copy github gists from alfred.
Quiver-alfred - https://github.com/danielecook/Quiver-alfred - Search and open quiver notes
codebox-alfred - https://github.com/danielecook/codebox-alfred - Search and copy codebox snippets.
I've come to rely on the codebox and gist workflows for managing snippets quite a bit.
Terminal
Autojump https://github.com/wting/autojump - Remembers what directories you have visited and allows you to jump to them. Jump to them by typing
j
pyenv - https://github.com/pyenv/pyenv + python-virtualenv - Manage python versions or virtual environments at the directory level. Makes managing multiple projects with different software requirements much easier.direnv - https://direnv.net - Similar to pyenv except it allows you to set environmental variables. Useful for setting things like API keys.
Sublime-Text
I'm a big fan of sublime text. Some of my favorite packages are:
git - https://github.com/kemayo/sublime-text-git - Add, commit, branch, push, pull
GitGutter - https://github.com/jisaacks/GitGutter - Shows which lines are modified, added, and deleted in the gutter of the editor.
SendCode - https://github.com/randy3k/SendCode - Send code to the terminal/iTerm/IDE.
SublimeLinter-flake8 - https://github.com/SublimeLinter/SublimeLinter-flake8 - Used to clean up Python code.
[ranger]: http://ranger.nongnu.org/ [autojump]: https://github.com/wting/autojump [fzf]: https://github.com/junegunn/fzf
Elevate your command line game:
autojump https://github.com/wting/autojump
ag https://github.com/ggreer/the_silver_searcher
Use zsh and put this in .zshrc https://gist.github.com/chx/f9509cb2db6595be334ca2404fac8a91
Now you can jump to directories freely with just j afewcharactersfromthedirname, search their contents with ag super fast and if you ever figured out something on the command line, you can recall it after this. For example, I remember I was searching dangling commits with awk so I do Ctrl+Rgit*awk and there it is. (I posted this particular command to http://stackoverflow.com/questions/21903972/search-for-strin... but that's less relevant to the topic here so I won't repeat here.)