Live data from Hacker News

FZF and RipGrep – Navigate with bash faster than ever before

owen.cymru

31–40 of 55 posts

Re: FZF and RipGrep – Navigate with bash faster than ever before

#31
post #3

These look awesome! If you're willing to put in that much effort to learn new tools though, could also try zsh or fish. The built-in autocomplete of both over bash is on another level.

There are good reasons to use Zsh beyond its autocomplete system. Zsh parameter expansions are a beautiful thing. When I write CLI scripts, I don't write Bash scripts, I write Zsh scripts. Documentation, however, is lacking. It's not quite as bad as Vim, but there are massive swaths of the program, entire subsystems, that are more or less completely undocumented. It's very user unfriendly. Also, the ad-hoc "plugin" e…

I've been using zsh for a long time and I didn't know it had native plugins, a bytecode compiler, an FTP client and a calendar.

To be frank, that's kind of scary, I'll probably have to take another look at fish :)

Re: FZF and RipGrep – Navigate with bash faster than ever before

#32

I am using ag. Is it worth changing to RipGrep ? The other unix command line tool that I love is autojump. I am thinking on trying fish and probably fzf.

I wanted to try fish too, but too many plugins or libs has a warning on github "does not work with fish" so I just saved myself some headaches and decided to resume with using already great zsh.

Re: FZF and RipGrep – Navigate with bash faster than ever before

#34
post #3

These look awesome! If you're willing to put in that much effort to learn new tools though, could also try zsh or fish. The built-in autocomplete of both over bash is on another level.

There are good reasons to use Zsh beyond its autocomplete system. Zsh parameter expansions are a beautiful thing. When I write CLI scripts, I don't write Bash scripts, I write Zsh scripts. Documentation, however, is lacking. It's not quite as bad as Vim, but there are massive swaths of the program, entire subsystems, that are more or less completely undocumented. It's very user unfriendly. Also, the ad-hoc "plugin" e…

Zsh was undocumented in Ubuntu 14 because a bug in the package prevented the manuals from being installed and due to the way Canonical handles packages it was never fixed for the entirety of Ubuntu 14.

I am one of those few remaining Zsh users that doesn't have an 200MB baggage train on my shell though. I have a modest (2kb) .zshrc/.zshenv and for the most part just use the builtins.

Re: FZF and RipGrep – Navigate with bash faster than ever before

#36
For dev work, I still prefer cscope for searching for things, at least in all supported languages. cscope is _fantastic_. Combined with a $CSCOPE_EDITOR that does the right thing (for me: open $EDITOR in the background in a new tmux window titled after the file being edited, returning control to cscope for additional searches / opens).

What's really good about cscope is this:

- multiple search types such as: where is this symbol assigned to, what functions call this function, where is this defined, where is this referenced, and so on

- curses and CLI interface

- the curses interface is very nice

- the CLI interface is very useful for integration into your $EDITOR, whatever it might be

The only downside is that cscope only supports C-like languages and a few others like yacc. So this works for C, C++, and Java (to a lesser extent), but does not work at all for languages like, say, Python.

Re: FZF and RipGrep – Navigate with bash faster than ever before

#37

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.

Probably 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  (219 /var): dirs -v
  0	/var
  1	/usr/local
  2	~
  FreeBSD  (220 /var): cd +1
  /usr/local
  FreeBSD  (221 /usr/local): _

Re: FZF and RipGrep – Navigate with bash faster than ever before

#38
post #11

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.

Scratched 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 r…

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/mast...

Re: FZF and RipGrep – Navigate with bash faster than ever before

#39

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.

https://github.com/rupa/z could also be interesting for you.

Also interesting is fzf-marks:

https://github.com/urbainvaes/fzf-marks.git

Re: FZF and RipGrep – Navigate with bash faster than ever before

#40
post #9

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.

I’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

Autojump 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

Post reply on HN