Live data from Hacker News

FZF and RipGrep – Navigate with bash faster than ever before

owen.cymru

1–10 of 55 posts

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

#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" ecosystem is in a strange and fragmented state. It's a shame that more people don't write actual modules in C (yes, Zsh has a native module system), but then again, is the API even documented?

The thing about Fish vs Zsh is that Zsh, with all those pre-command hooks running in Zsh scripts to replicate out-of-the-box Fish functionality, it's slow. I haven't tried compiling my plugin files (yes, Zsh also has a byte compiler), so maybe that would help. But I've occasionally found myself poring over logs from zsh -x to see diagose my 200ms delay.

One more thing about Zsh: it has emacs syndrome. Do your really need an FTP client and calendar built into your shell?

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

#5
post #4

The second post i read today about fzf. And also again i see ripgrep. I think it is time to make these tools a default in linux distros. Maybe a small you could use ripgrep instead of grep, just before the first use of these tools would be interesting.

Hope you don't mind some brief clarifications.

Work on adding ripgrep to Linux distros is being tracked here[1]. We've made good progress so far, but AFAIK it's still missing in Ubuntu and Debian. I'm not caught up with what's required to get ripgrep into those repos.

With respect to making it a literal default---as in replacing GNU grep---I don't really expect that to ever happen. There is a ton of intersection between the tools, right down to the names and functionality of flags, but there's also many subtle details in the differences. For example, normal grep invocations will use BREs by default, which have different escaping rules than EREs, where EREs are closer to what ripgrep uses. There's also the difference where ripgrep respects things like .gitignore and ignores hidden files by default, which means there's likely a non-zero number of shell scripts out there where swapping grep for ripgrep will break. Folks won't (and shouldn't) take too kindly to that. :-)

To a first approximation, ripgrep is optimized for end user experience in a terminal. This leads to different design decisions. Offering a compatibility mode with grep has been suggested, but is significant work.

[1] - https://github.com/BurntSushi/ripgrep/issues/10

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

#6
post #4

The second post i read today about fzf. And also again i see ripgrep. I think it is time to make these tools a default in linux distros. Maybe a small you could use ripgrep instead of grep, just before the first use of these tools would be interesting.

Hope you don't mind some brief clarifications. Work on adding ripgrep to Linux distros is being tracked here[1]. We've made good progress so far, but AFAIK it's still missing in Ubuntu and Debian. I'm not caught up with what's required to get ripgrep into those repos. With respect to making it a literal default---as in replacing GNU grep---I don't really expect that to ever happen. There is a ton of intersection betw…

Have you set up a Hackernews/Reddit crawler that pings you each time someone mentions "ripgrep"? Seriously, I'd be interested in knowing what solution you use.

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

#7

Earlier quoted context omitted.

Hope you don't mind some brief clarifications. Work on adding ripgrep to Linux distros is being tracked here[1]. We've made good progress so far, but AFAIK it's still missing in Ubuntu and Debian. I'm not caught up with what's required to get ripgrep into those repos. With respect to making it a literal default---as in replacing GNU grep---I don't really expect that to ever happen. There is a ton of intersection betw…

Have you set up a Hackernews/Reddit crawler that pings you each time someone mentions "ripgrep"? Seriously, I'd be interested in knowing what solution you use.

I just saw it on the front page, which I check embarrassingly frequently. :-) (But I do have a Google Alert setup for it, sure.)

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

#8
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.

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

#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

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

#10
post #4

The second post i read today about fzf. And also again i see ripgrep. I think it is time to make these tools a default in linux distros. Maybe a small you could use ripgrep instead of grep, just before the first use of these tools would be interesting.

Hope you don't mind some brief clarifications. Work on adding ripgrep to Linux distros is being tracked here[1]. We've made good progress so far, but AFAIK it's still missing in Ubuntu and Debian. I'm not caught up with what's required to get ripgrep into those repos. With respect to making it a literal default---as in replacing GNU grep---I don't really expect that to ever happen. There is a ton of intersection betw…

> Work on adding ripgrep to Linux distros is being tracked here[1]

There are multiple interpretations of the GP's comment, each one being a prerequisite of the next:

- ripgrep is available in the distro repos - ripgrep is included on the main install medium (first Debian CD, Arch net iso even?) - ripgrep is selected for inclusion on a default install (but grep is still there) - ripgrep replaces grep altogether

On first read I though we were talking about the third one.

> where swapping grep for ripgrep will break

> Offering a compatibility mode with grep has been suggested, but is significant work.

Do you mean by that, that 'rg' could change its defaults and behave like 'grep' when being invoked as 'grep' (through symlink or hardlink), similarly to bash/sh or vi/vim?

Post reply on HN