Hacker News new | past | comments | ask | show | jobs | submit login

bat [0] (a cat replacement) and fzf [1] are the other two I would miss dearly, standing above some other "new" tools I use very regularly.

  [0]: https://github.com/sharkdp/bat
  [1]: https://github.com/junegunn/fzf



See also delta for diffing (and as a drop-in replacement for git diff) and exa for ls.

https://github.com/dandavison/delta

https://github.com/ogham/exa


Yes, I have it enabled as git's diff. I have tried exa but didn't see much difference. Anything remarkable I may be missing from exa?


It has a flag to add a “Git” column to the output, showing the status of each file in the listing (new/modified/etc.) it also has a `—tree` flag which does exactly what you think it does. This let me remove my old `tree` command and consolidate into one.


fzf is another that is just absurdly powerful. fzf comes in handy in so many useful little scripts for me.


What do you use fzf for? I can't figure out a use case for it but everyone seems to love it, what am I missing on?


The main thing I get out of it is super amazing fuzzy-search of my terminal history. Normally with bash's built in CTRL-R reverse history search, you pretty much have to know EXACTLY what you're searching for, and if there are a lot of similar commands between the most recently run match for a search and the one you're ACTUALLY searching for, you may have a really hard time finding it since you have to go backwards through the commands one at a time. For myself and many people, we were getting really good at typing `history | grep '<regex>'`, maybe with more pipes to grep for further refinement.

But with fzf[1], that whole workflow of searching through your history is probably two orders of magnitude faster. Now you hit CTRL-R and you start typing any random part of the command you're trying to remember. If there was some other part of the command you remember, hit space and type that search term after the first search term. FZF will then show you the last 10-ish matches for all the search params you just typed, AND it will have done all this with no UI lag, no hitching, and lightning fast.

I don't know what other people use FZF for, as this is the SINGLE feature that's so good I can't live without it anymore.

[1] - https://github.com/junegunn/fzf#key-bindings-for-command-lin...


Here's an example with rip grep. Say you search for something with a lot of results, you can feed the results with a lot of answers into it, and then add additional filters. Useful for when you're not "exactly" sure what your search term needs to be. I use it when ripgrepping a lot of code bases all at once....

I also have a folder of a bunch of curl commands that I can search and apply fuzzy finding on the results that helps me explore to find.

Contrived example, search for "t" in all these files and then pipe to fzf: rg t . | fzf


I use it multiple times every day to switch to already existing git branches, checkout remote branches with creation of tracking branch, or to checkout remote branches in detached HEAD mode. I made git aliases for those, and this is how it looks like in my .gitconfig:

  [alias]
    cof = !git for-each-ref --format='%(refname:short)' refs/heads | sort | uniq | fzf | xargs git checkout
    cor = !git branch --list --remotes | sed 's@origin/@@' | sort | uniq | fzf | xargs git checkout
    cord = !git branch --list --remotes | sort | uniq | fzf | xargs git checkout


1. built in to zsh so I can fuzzy find my command history 2. similarly command t let's me do.. for example ```bat <ctrl t> (and fuzzy find whatever file I want``` 3. it's a vim plugin so it's a replacement the need for nerd tree, can be used as a file explorer, buffer finder, fuzzy find lines instead of / search, switch branches, etc 4. fzf-tab for zsh gives you fuzzy tab completion in your terminal too


I use it for switching git branches. I have this in ~/bin/git-bsel:

    git for-each-ref refs/heads/ --format='%(refname:short)' --sort='-authordate' | fzf +s --query "$*" | xargs git checkout


I actually prefer fzy to fzf because it doesn't go fullscreen, but I think the simplest convincing example is:

    alias f = fd | fzy


Mine are fd [0] to replace `find` and tldr [1] to replace `man`.

[0]: https://github.com/sharkdp/fd

[1]: https://tldr.sh/


I find repgrep defaults sensible when searching for text but fd misses files that I expect it to find -- this has happened a few times now and I have gone back to find.

For instance: 'fd .apk' to search for android builds.


Unlike find, fd follows the rg approach of respecting VCS ignores, which does have both advantages and disadvantages. But if you know you’re specifically searching for a binary, just pass -u (once to include VCS-ignored files, or even twice to also include hidden ones) and you’re golden. In your specific example you probably also want -F (fixed string) or -g (glob), because fd does regexes by default and I doubt you want to type '\.apk'.

As to find, its flexibility certainly comes handy on occasion, but...

  find: paths must precede expression
Aaaargh.


I like cheat.sh as the alternative for tldr which doesn't need to be installed as all, because it can be used with curl:

  $ curl cheat.sh/tar


fd is fantastic as well, and I can get away with tldr 80% of the time before diving into man.


Have you looked at the original man pages for 7th ed. (http://man.cat-v.org/unix_7th) or Plan 9 (http://man.cat-v.org/plan_9_3rd_ed)? They’re basically tldr with less examples, and exhaustive, except there’s so much less stuff to exhaust. I was both pleasantly surprised by how simple they are and unpleasantly surprised by how far we’ve fallen in terms of complexity (though my recent comment https://news.ycombinator.com/item?id=27498189 explains why that’s an oversimplification). The GNU man pages (where they even exist) or the POSIX ones are a usability abomination in comparison. Even BSD’s are still quite bad.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: