bash: fix function compatibility
This commit is contained in:
parent
b71d05327a
commit
eeee10a6fc
|
@ -41,7 +41,7 @@ alias rm='rm -I'
|
||||||
alias cp='cp -i'
|
alias cp='cp -i'
|
||||||
alias mv='mv -i'
|
alias mv='mv -i'
|
||||||
|
|
||||||
# Bash completion
|
# Completion and Extras
|
||||||
|
|
||||||
src() { test -f "$1" && source "$1"; }
|
src() { test -f "$1" && source "$1"; }
|
||||||
|
|
||||||
|
@ -52,7 +52,6 @@ bind '"\ej":history-search-forward'
|
||||||
shopt -oq posix || src /etc/bash_completion
|
shopt -oq posix || src /etc/bash_completion
|
||||||
|
|
||||||
# Fancy prompt
|
# Fancy prompt
|
||||||
|
|
||||||
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]"
|
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]"
|
||||||
PS1="$PS1 \`if [ \$? = 0 ]; then echo -e '\[\033[01;32m\]:)';"
|
PS1="$PS1 \`if [ \$? = 0 ]; then echo -e '\[\033[01;32m\]:)';"
|
||||||
PS1="$PS1 else echo -e '\[\033[01;31m\]' \$?; fi\`\[\033[00m\]"
|
PS1="$PS1 else echo -e '\[\033[01;31m\]' \$?; fi\`\[\033[00m\]"
|
||||||
|
|
|
@ -175,11 +175,11 @@ alias syslog='less +F /var/log/syslog'
|
||||||
alias sc='sudo systemctl'
|
alias sc='sudo systemctl'
|
||||||
alias scd='sudo systemctl disable --now'
|
alias scd='sudo systemctl disable --now'
|
||||||
|
|
||||||
|
unalias scs sce 2>/dev/null
|
||||||
sce() {
|
sce() {
|
||||||
sudo systemctl enable --now "$@" ||
|
sudo systemctl enable --now "$@" ||
|
||||||
sudo systemctl status "$@"
|
sudo systemctl status "$@"
|
||||||
}
|
}
|
||||||
unalias scs 2>/dev/null
|
|
||||||
scs() {
|
scs() {
|
||||||
(
|
(
|
||||||
export SYSTEMD_COLORS=true
|
export SYSTEMD_COLORS=true
|
||||||
|
@ -478,7 +478,7 @@ which exa >/dev/null &&
|
||||||
alias l='exa --icons' &&
|
alias l='exa --icons' &&
|
||||||
alias ll='l --long --extended --git --all'
|
alias ll='l --long --extended --git --all'
|
||||||
|
|
||||||
if which fd >/dev/null
|
if which fd >/dev/null 2>&1
|
||||||
then fn() { $(command -v fd || echo fdfind) --hidden --no-ignore-vcs --one-file-system "$@" | less -F; } # [F]ind [n]o ignore
|
then fn() { $(command -v fd || echo fdfind) --hidden --no-ignore-vcs --one-file-system "$@" | less -F; } # [F]ind [n]o ignore
|
||||||
alias ff="noglob fn --color=always " # [F]ind [F]ile
|
alias ff="noglob fn --color=always " # [F]ind [F]ile
|
||||||
compdef ff=fd
|
compdef ff=fd
|
||||||
|
|
Loading…
Reference in New Issue