- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
Ctrl R
holy fucking shit 🤌💪🤯❤️💯
I’ve been using
ctrl + R
more now :3… though I definitely used to ↑↑↑↑↑↑↑check out fzf (install fzf and add (assuming bash)
eval "$(fzf --bash)"
to your .bashrc) Makes ctrl+r a superpowerCtrl + r with fzf and you’ll never go back.
Woah Ctrl R looks super cool, never knew that I could do that before…
I knew there was an
ls
In there somewhere
ctrl + r, l, s
Much faster than simply typing
ls
!ls … enter ↑ enter ↑ enter
You may consider using
watch ls
I can’t even keep apart ls and cd it seems.
The number of people who don’t reverse-I-search is too damn high
CTRL+R for those unitiated
reverse-i-search + fzf = <3
It was quite a while before I realised that was possible.
Then not long after starting to use it, that I got fed up and just started opening up the history file and searching in it.why not
history | grep -i
and the search term?even if there are several, you can use ! and the command’s line number to run it again
history
is shell dependent.
I typed it once, I’m not typing it again
…until you press up one too many times and enter the same command but with a typo. Again.
There is an option you can set in .zshrc or .bashrc which only includes lines that exit 0 (success)
Infuriatingly that would omit things like unit test runners from the history in case they don’t pass. As a developer I tend to re-run failed commands quite often, not sure how widely that applies, though.
Oh, stuff like
git diff
andgit log
will end up being omitted pretty often.
And a lot of times, the commands that end with piping intoless
Been there, done that.
I write part of the command then ctrl+r. Using FZF mind you. Such a great utility.
Fish once again undefeated. If I want to find that weird image magick command I used earlier with foo.png in it I just type
foo.png
, hit up and its usually the first one. It doesnt matter where foo.png occurs in the command, fish will find it.fish has “directory-aware” autocomplete with inlay hints and a fantastic
history
command. I do not suffer from such weakness
or documentation.In
fish
, you can enter part of the command, and then press up to search for it. It’s kinda awesome.That’s what I do in bash except for pressing up it’s ctrl+r. FZF does the fuzzy finding for me. It’s so convenient.
^r
and whenever you forget to sudo:
sudo !!
You need this: https://github.com/nvbn/thefuck
Ctrl-r, l ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r. To get ls.
https://github.com/atuinsh/atuin is a great tool to manage and search your shell history. I especially enjoy it being able to search commands based on the working directory I was in when I ran them.
It also has more features (which I don’t use) to manage dotfiles and sync shell history across hosts/devices.
This is why I like atuin, I can just press up and start typing part of the command and it will likely find it in my history.
I just use mcfly
Not sure I understand the point of mcfly. zsh and fish have this functionality built in, where pressing Up with a command partially typed will give auto-completions to that partial match.
Yeah. I also use auto-completions for that. McFly does fuzzy finding and because it’s a different separate db, for me it works better across many sessions to find commands I had just recently used in another session.