nu: Copy basic sh aliases

Held back a little by the issue that you can't really set aliases
conditionally (yet?) in nushell, which is kind of fundamental to my
zsh/sh alias setup. If a program exists, we add some nice aliases -- if
not, we simply degrade gracefully and don't add anything.

PR to track issue:
https://github.com/nushell/nushell/issues/5068
This commit is contained in:
Marty Oehme 2025-11-29 15:58:51 +01:00
parent dc8030f905
commit dc71f747da
Signed by: Marty
GPG key ID: 4E535BC19C61886E
3 changed files with 63 additions and 15 deletions

View file

@ -8,7 +8,10 @@ exist() { type "$1" >/dev/null 2>&1; }
unalias -a
if alias v >/dev/null 2>&1; then
if exist vim; then
if exist nvim; then
alias v="nvim"
alias vim="vi"
elif exist vim; then
alias v="vim"
else
alias v="vi"