| ▲ | phforms 4 hours ago | ||||||||||||||||||||||
The thing with a lot of these tricks is that you have to get into the habit of using them. I knew `Ctrl+r` for history since I learned about the command line. I even have a nice shell integration with fzf. But I still used the up/down arrow keys for years or scrolled up when I was looking for a previous command, because I never remembered the shortcut and just took the path of least resistance to find something. Usually what I do is writing these tricks down to a document that is easily accessible at a place where I know that I will look for when failing to remember them. I have a directory of docs where I write stuff like this down by language/tool/etc., so I can quickly look it up without having to search the internet. But I also have to actively remind myself that these things exist whenever I have a problem, stop me from just doing the inefficient thing. | |||||||||||||||||||||||
| ▲ | diath 3 hours ago | parent | next [-] | ||||||||||||||||||||||
> But I still used the up/down arrow keys for years or scrolled up when I was looking for a previous command It's not even that bad of a habit with zsh either where it will only scroll through history matching a substring in your history, for instance if I type "rg -i" and then start pressing up arrow, it will only cycle through history entries starting with "rg -i". | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | dec0dedab0de 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
I was my most effective when I had a bunch of cheat sheets taped up in my workspace. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | quirino 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
atuin kind of fixes this habit, when you click up you get a list of the latest commands, and you can just start typing to search. It's extremely natural. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | fragmede an hour ago | parent | prev | next [-] | ||||||||||||||||||||||
| ▲ | lelandbatey 37 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
It's quite true. Years ago, after `git switch` was released, I wanted to try to switch from `git checkout` to `git switch`. Ultimately I had to set up some bash nastiness to error and "scold" me when I typed `git checkout` from memory, while still allowing shell scripts to call `git checkout` just fine. It was a fun exercise, and at least now I know how I could do it again: https://github.com/lelandbatey/dotfiles/blob/99c08f81fc89710... | |||||||||||||||||||||||
| ▲ | reaperducer an hour ago | parent | prev [-] | ||||||||||||||||||||||
Usually what I do is writing these tricks down to a document that is easily accessible at a place where I know that I will look for when failing to remember them. People had this same problem last century. They would use templates that fit over their keyboards with all the common shortcuts and commands printed on them. Sometimes they were for a specific program, but you could buy blank ones to write your own notes. Today, "keyboard templates" have an entirely different meaning, so the best thing for this is paper. Print your shortcuts out on a piece of paper and put it near your monitor. You could even categorize them by writing them on different-colored Post-Its. | |||||||||||||||||||||||