this post was submitted on 30 Dec 2024
48 points (100.0% liked)

Programming

22147 readers
7 users here now

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



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] nous@programming.dev 21 points 7 months ago (5 children)

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.

[–] salmoura@lemmy.eco.br 9 points 7 months ago (1 children)

I'm also in that camp. FZF is a life saver.

[–] jbrains@sh.itjust.works 4 points 7 months ago

Yes! I raise you atuin.

[–] atzanteol@sh.itjust.works 5 points 7 months ago (1 children)

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.

[–] nous@programming.dev 5 points 7 months ago

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.

[–] SwordInStone@lemmy.world 5 points 7 months ago (1 children)

you might want to take a look into shell abbreviations

e. g.

https://github.com/olets/zsh-abbr

[–] nous@programming.dev 2 points 7 months ago (1 children)

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.

[–] asret@lemmy.zip 3 points 7 months ago

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.

[–] dinckelman@lemmy.world 1 points 7 months ago

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