Update .zshrc
Updating to the version of .zshrc on Tau Scorpii. This enhanced version has a couple of improvements: * Aliases moved to a separate file for easier maintenance * Auto-discovery of functions on fpathmaster
parent
7cab8a6bda
commit
48e913c8ce
|
@ -0,0 +1,28 @@
|
||||||
|
# General commands
|
||||||
|
alias rm='rm -I'
|
||||||
|
alias ls='LC_COLLATE=C ls -N --color=auto --group-directories-first'
|
||||||
|
alias grep='grep --color=auto'
|
||||||
|
|
||||||
|
# Git
|
||||||
|
alias g='git status'
|
||||||
|
alias gc='git diff --cached --color|less -S'
|
||||||
|
alias gd='git diff --color|less -S'
|
||||||
|
alias gl='git log --graph --oneline --decorate --date-order --all --color|less -S'
|
||||||
|
alias gs='git show --pretty=fuller --stat --patch --color HEAD|less -S'
|
||||||
|
|
||||||
|
# Mercurial
|
||||||
|
alias hd='hg diff --color=always|less -S'
|
||||||
|
alias hl='hg shortlog --graph --color=always|less -S'
|
||||||
|
alias hs='hg export --color=always|less -S'
|
||||||
|
|
||||||
|
# Python development
|
||||||
|
alias pep8='PYTHONWARNINGS= pep8'
|
||||||
|
alias pylint='PYTHONWARNINGS= pylint -rn'
|
||||||
|
alias flake8='PYTHONWARNINGS= flake8'
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
alias aws='PYTHONWARNINGS= aws'
|
||||||
|
alias rmrpmbuild='rm -rf BUILD BUILDROOT RPMS SRPMS'
|
||||||
|
alias apache2='/usr/sbin/apache2 -d ~/.local/lib64/apache2 -f httpd.conf'
|
||||||
|
alias openconnect='/usr/sbin/openconnect -i vpn0 --juniper --syslog -b --pid-file=/tmp/openconnect.pid -u dhatch ssl.firemon.com'
|
||||||
|
alias ipsec='/usr/sbin/ipsec'
|
42
.zshrc
42
.zshrc
|
@ -28,31 +28,13 @@ bindkey -M viins "${terminfo[kdch1]}" vi-delete-char
|
||||||
bindkey -M vicmd "${terminfo[kdch1]}" vi-delete-char
|
bindkey -M vicmd "${terminfo[kdch1]}" vi-delete-char
|
||||||
bindkey "^R" history-incremental-search-backward
|
bindkey "^R" history-incremental-search-backward
|
||||||
|
|
||||||
alias rm='rm -I'
|
if [[ -f ${ZDOTDIR:-${HOME}}/.zshalias ]]; then
|
||||||
alias ls='LC_COLLATE=C ls -N --color=auto --group-directories-first'
|
source "${ZDOTDIR:-${HOME}}/.zshalias"
|
||||||
alias g='git status'
|
fi
|
||||||
alias gc='git diff --cached --color|less -S'
|
|
||||||
alias gd='git diff --color|less -S'
|
|
||||||
alias gl='git log --graph --oneline --decorate --date-order --all --color|less -S'
|
|
||||||
alias gs='git show --stat --patch --color HEAD|less -S'
|
|
||||||
alias hd='hg diff --color=always|less -S'
|
|
||||||
alias hl='hg shortlog --graph --color=always|less -S'
|
|
||||||
alias hs='hg export --color=always|less -S'
|
|
||||||
alias pep8='PYTHONWARNINGS= pep8'
|
|
||||||
alias pylint='PYTHONWARNINGS= pylint -rn'
|
|
||||||
alias flake8='PYTHONWARNINGS= flake8'
|
|
||||||
alias aws='PYTHONWARNINGS= aws'
|
|
||||||
alias grep='grep --color=auto'
|
|
||||||
alias rmrpmbuild='rm -rf BUILD BUILDROOT RPMS SRPMS'
|
|
||||||
alias apache2='/usr/sbin/apache2 -d ~/.local/lib64/apache2 -f httpd.conf'
|
|
||||||
alias openconnect='/usr/sbin/openconnect -i vpn0 --juniper --syslog -b --pid-file=/tmp/openconnect.pid -u dhatch ssl.firemon.com'
|
|
||||||
alias ipsec='/usr/sbin/ipsec'
|
|
||||||
|
|
||||||
zstyle ':completion:*:sudo::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root"
|
zstyle ':completion:*:sudo::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root"
|
||||||
|
|
||||||
typeset -U path
|
|
||||||
typeset -U fpath
|
typeset -U fpath
|
||||||
|
|
||||||
fpath[1,0]=~/.zsh/functions
|
fpath[1,0]=~/.zsh/functions
|
||||||
|
|
||||||
case $TERM in
|
case $TERM in
|
||||||
|
@ -61,17 +43,22 @@ case $TERM in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
autoload kadmin
|
for x in ~/.zsh/functions/*; do
|
||||||
autoload startrole
|
f="${x##*/}"
|
||||||
autoload switchrealm
|
case "$f" in
|
||||||
autoload vmip
|
_*|precmd)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
autoload "${x##*/}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
autoload -U compinit promptinit
|
autoload -U compinit promptinit
|
||||||
compinit
|
compinit
|
||||||
promptinit
|
promptinit
|
||||||
|
|
||||||
os=$(. /etc/os-release; echo $ID)
|
case "$(. /etc/os-release; echo $ID)" in;
|
||||||
case ${os} in;
|
|
||||||
gentoo)
|
gentoo)
|
||||||
prompt gentoo
|
prompt gentoo
|
||||||
;;
|
;;
|
||||||
|
@ -79,4 +66,3 @@ centos|redhat|rhel)
|
||||||
prompt redhat
|
prompt redhat
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
unset os
|
|
||||||
|
|
Reference in New Issue