I switched to Fish and one thing I really enjoy is abbreviation. The expansion of abbreviations when typing them in the terminal is really useful. Not only because I do see what it does, I can also change the arguments right there before execution. To me this is a killer feature.
alias -g. i think abbrev is better. meaning, type something you've defined; then do a space or punctuation and the abbreviation will expand. benefit of immediate feedback.
I use the OS specific alias to run chrome on mac os when I type "chromium", so that I can keep the same scripts from linux and mac os. On mac for some reason launching chrome by typing chrome doesn't work, so I just make the alias execute the launch script thing inside the chrome folder in mac os' applications folder.
global aliases are a neat idea, but can get weird as you mentioned. the grml zshrc has a neat 'abbreviation' implementation that acts like global aliases but can be a bit safer to use as they are expanded to their meaning explicitly/implicitly as you want.
A lot of my aliases became too complex over time so I had to convert them to functions. I don't have any OS specific aliases which are completely unique but I do use the same idea to have different versions of an alias depending of the system because windows can require some work arounds. I also have some tmux specific aliases which I detect in a similar way.
@@raxa45 "electric" is the term Emacs uses, for bracket auto pairing and auto indenting. I guess i won't use the term "electric" now, "auto" seems better to use.
Do you have any interest in cleaning up ~/ like Luke has his? I see what he has, and I see what I have (similar to what you have) but I can't see a way to get from A->B without breaking my world. If this interests you, a video would be great.
I only use bash so I use normal aliases and functions. I don't consider functions to be an alias I haven't thought about using global aliases. Reminds me of sub on MUDs. I rarely used them there.
@@BrodieRobertson i suppose but it's not really string subsitution it's really still command substitution if you run cat .zshrc | color it will say "unknown command" string substitution can be achieve with !!:0-2 and it's variants and ^zsh^bash and its variants
I was searching in the comments that bash nerd to tell how to do all these things in bash and tell zsh is not necessary. 😜 And of course it can be done in bash through other means.
They can also be a function tooo they don't need to be a single line... Example here mate lol github.com/TheCynicalTeam/DotFiles/blob/master/.bash_aliases