5 ms·
I love the combination of these! Really opens up a world of possibilities. The one command I'm still trying to replace is `cd` itself. For instance, can anyone
by graffitici 9y ago
I love the combination of these! Really opens up a world of possibilities. The one command I'm still trying to replace is `cd` itself. For instance, can anyone suggest a way to add bookmarks, so that I can move around faster? I found a few, but was never happy with them.
- haar 9y agoI’ve been enjoying autojump [1], it automagically creates bookmarks and prioritises them based on frequency of visiting said folders. [1] https://github.com/wting/autojump https://github.com/wting/autojump
- gepoch 9y agoAutojump is the answer here. Totally a gamechanger. If you like its semantics enough, check out fasd [1] , which is a superset of autojump that applies its cache in many other places. Absolutely awesome. [1] https://github.com/clvv/fasd https://github.com/clvv/fasd
- lloeki 9y agoScratched that itch of mine for bash/zsh in 30 lines[0]. kd stands for quicKDir or worKDir depending on the moon. kd foobar ~/Workspace/foobar # define bookmark cd ~/some/where kd foobar # goes to bookmark kd foo # matches on string prefix, last entry wins cd ~/Workspace/quuuuuux kd qux "$PWD" # quick bookmark current dir touch Gemfile # define project root cd app/controllers/name/space/whatevs kd # goes to project root Turns out autojump doesn't work for me, too many projects in parallel. Since this one is manual, it can be very semantic. Those 30 lines saved me hours on end of tab mashing, especially in Go workspaces. [0]: https://github.com/lloeki/dotfiles/blob/master/shell/kd https://github.com/lloeki/dotfiles/blob/master/shell/kd
- cryptonector 9y agohttp://cryptonector.com/2007/04/c-shell-pushdpopd-on-steroids-as-korn-shell-functions/ http://cryptonector.com/2007/04/c-shell-pushdpopd-on-steroid... I have been doing something similar for many years. Someone ported this to Bash... I'll try to get that port up on github. EDIT: https://raw.githubusercontent.com/jakobi/script-archive/master/cli.shell.functions/dir.shell/cd.nico_cd_for_bash_and_ksh.func https://raw.githubusercontent.com/jakobi/script-archive/mast...
- kbd 9y agoI recommend https://github.com/clvv/fasd https://github.com/clvv/fasd It basically makes bookmarks automatically as you navigate your filesystem anyway.
- herrvogel- 9y agohttps://github.com/rupa/z https://github.com/rupa/z could also be interesting for you.
- pmoriarty 9y agoAlso interesting is fzf-marks: https://github.com/urbainvaes/fzf-marks.git https://github.com/urbainvaes/fzf-marks.git
- Midasx 9y agoIt isn't super clear in the article, but I now use bfs & fzf for replacing cd. https://github.com/bag-man/dotfiles/blob/master/bashrc#L73 https://github.com/bag-man/dotfiles/blob/master/bashrc#L73 Lets you change directory with alt+c, although I have tweaked it so you always search from your root folder. Which isn't for everyone. Otherwise fzf alt+c doesn't let you go back up directories which gets frustrating.
- HurrdurrHodor 9y agoI've just tried this and in my case it leads to "cd \~[...]" which obviously does not work.
- Midasx 9y agoThat's strange. Maybe just change it to: export FZF_ALT_C_COMMAND="bfs -type d -nohidden" (and install bfs of course) It won't let you go back up the tree, but if you are clever you can use `cd -` to jump back to your previous location.
- tavianator 9y agoHey, bfs author here, glad you've found it useful! You can do that whole thing in one command with bfs ~ -nohidden -type d -printf '~/%P\n'
- p1xelHer0 9y agoI use a combination of https://github.com/clvv/fasd https://github.com/clvv/fasd and https://github.com/ranger/ranger https://github.com/ranger/ranger. When tasks like navigating into a project, starting tests, local server and neovim become repetitive I usually end up making a tmux script which does everything for me. Also, aliasing ‘..’ to ‘cd ..’ and such.
- masklinn 9y ago> The one command I'm still trying to replace is `cd` itself. zsh will implicitly cd if you just mention a directory e.g. `$ ../foo/bar [RET]` will cd there without mention. These days I only use `cd -`.
- jandrese 9y agoIIRC that isn't the default. You need to enable the option for that to work. zsh has about a thousand options you can configure.
- masklinn 9y ago> IIRC that isn't the default. You need to enable the option for that to work. You're right, it's been so long I completely forgot. It's auto_cd, and auto_pushd will also automatically push new directories to the dstack. > zsh has about a thousand options you can configure. I should probably go through the options list in its entirety one day, but technically according to http://zsh.sourceforge.net/Doc/Release/Options.html http://zsh.sourceforge.net/Doc/Release/Options.html it's closer to a quarter of that ;)
- therein 9y agoI think it is enabled by default. I never explicitly enabled it for my zsh configuration and it behaves that way.
- vthriller 9y ago> These days I only use `cd -`. There's also `cd foo bar` in zsh, which substitutes foo with bar in the name of $PWD. I rarely used it, and when I do, it's usually for a well known pair of lengthy named dirs, yet it also shaves off a couple of keystrokes pretty much daily for me.
- finnh 9y agoThe $CDPATH variable (built into `cd`)[0] plus the `bash_completion`[1] script to enable tab-completion of CDPATH dirs - works for my use case (FWIW). [0] http://linuxcommand.org/lc3_man_pages/cdh.html http://linuxcommand.org/lc3_man_pages/cdh.html [1] http://www.caliban.org/bash/index.shtml#completion http://www.caliban.org/bash/index.shtml#completion
- jandrese 9y agoProbably not exactly what you want, but the pushd/popd/dirs commands have existed in all major shells forever. You can run dirs -v to get the list, and do cd +(num) to go there. So: FreeBSD <jubei/pts/2> (219 /var): dirs -v 0 /var 1 /usr/local 2 ~ FreeBSD <jubei/pts/2> (220 /var): cd +1 /usr/local FreeBSD <jubei/pts/2> (221 /usr/local): _
- chewz 9y agoI have a little script that combines z and fzf. https://gist.github.com/chew-z/44f3bcdc08eaecdf306868f9a3d0eddd https://gist.github.com/chew-z/44f3bcdc08eaecdf306868f9a3d0e...