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.
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.
@@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.
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.
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
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.
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
I've only used simple aliases - until now. Learned a lot. Thanks.
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.
I really should try fish
Fish is great until you run a tool that wants posix sh compliance or a tool that thinks bash is the only thing
WOW! Good one Brodie! I learned a bunch! Thanks!
I only use alias something='command', and with Luke Smith, I learned that I don't need to type "alias xyz=" again, just
alias v="nvim" \
vim="nvim"
For the same reasons that I don't like defining variables in a programming language like this, I'm not a fan of defining aliases like this.
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.
That's odd, I don't really use MacOS enough to notice that
I think to launch chome in macos is: $ open -a "Google Chrome"
ah, you got electric quote pairing. do you have it for all the types of brackets as well?
Electric quote pairing? Do you mean auto pairing. I have it for all except for because it conflicts with my html tagging plugin.
I use the zsh-autopair plugin. Is electric another one?
@@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.
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.
how portable is `$OSTYPE`, especially compared to `uname`?
uname(1) is in POSIX, $OSTYPE is not.
tried echoing it now in Debian, nothing there.
@@humm535 Ah good to know.
Tried $OSTYPE on my machine's shells, bash and zsh had them, while bash as sh and dash didn't have.
'source .zsh'
you could also use 'exec yourshell'
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've never really thought about fixing it but it could make an interesting video
I use normal and suffix aliases in zsh.
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.
Also Take a look at gotbletu's dotfiles.
He's done his own videos on them I don't know what I could say that he didn't already say.
uh alias work after after the pipe because it's technically new command, it should also work after && and ;
I don't typically come into situations where I have 2 commands aliased that I want to chain
@@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
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.
How about a keybinding follow up in zsh using tmux. I dont like typing my alias.
I do need to take a proper look into tmux
Awesome.
Thanks, TH-cam apparently doesn't tell you when you get a new member, I only just checked the list.
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.
You don't have to type source everytime. Alternatively, you may use . ~/.zshrc
Thanks, I didn't know about that
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
the baby beard is very distracting