I seem to be one of very few people that does not use shell aliases. I much prefer just using the reverse history search for previous commands instead. That way I don't have to remember what letter I picked for different things, just ctrl+r then partially type out the command and I can see what it will execute. Bonus that I don't need to set them up before hand and that I can edit them before executing them for those times when I need to do something slightly different.
Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
I'm also in that camp. FZF is a life saver.
Yes! I raise you atuin.
TBH, not quite the same. You have to know which one you want. If you don't quite or get it wrong you need to clear the line and start again. I quite like that I can reverse search and keep typing, or undo what I had typed and still see a list of the most recent things and can select from that list once I see what I want. This works for any command I have previously typed and dont need to setup specific key sequences for it - just any part of that command will find it again. Also works for complex chains of commands or pipes which I do not think aliases do work for.
I quite like adding a fuzzy finder to the history search - helps when I can only remember part of the command line I was using. Have just started using atuin.sh which seems okay.
No, I'm the same. I started down that road but found myself too dependent on a lot of custom scripts and aliases. It became a pain when I used unix and Linux systems at work, or work in containers, etc.
I used to know a guy that would put everything into aliases or scripts in order to avoid remembering them. It worked well most of the time but when something went wrong or was not covered by his scripts he would struggle a lot. He avoided learning the underlying commands and what they did and so could not adapt to things when circumstances changed even a little - which does happen quite a lot.
Which is probably another reason I don't use them. I don't like to set them up straight away while I am learning the tool and once I am comfortable with it a reverse history search is good just as good/quick as a true alias anyway and means I never forget what I am doing and can edit it on the fly easily when needed.
I make ~/bin scripts that can be saved, then you have a backlog of real, backed up scripts you can add to path anywhere
I'm an apprentice to both your ways.
I create a tidy backed up script in ~/bin, and then I only ever evoke it from my bash history, because otherwise I don't remember I had it.
Yeah, that's what I do for complex stuff. Aliases are pretty handy too, but I use them for stuff like "v=nvim" and "vd=nvim -d". Also one function for fd to "nvim $(rf -l $1)"
I do use scripts for more complex things. But even then I have a few very frequent one liners in my history that are 3-4 commands chained together that I have not bothered to convert. It tends to only be when they start to have logic in them that I will write a script for. Or more one off commands that are easier to edit in a multi line editor then trying to get everything right in the shells prompt.
I do use aliases, though differently too. For example, i use multiple distros. Instead of "uh, what was the xbps command to find what package contains this file?" i just have it automatically set to a bunch of aliases in a case switch based on package manager. Another one; some tools that follow XDG only optionally via parameter.
Any time a shell alias would be useful, i have to setup an equivalent of a makefile anyway. My current setup has no aliases active, for the same reasons as you