zsh: reorganize
This commit is contained in:
parent
9e9e8afd5a
commit
1b61337582
4 changed files with 59 additions and 21 deletions
44
zsh/zsh-common
Normal file
44
zsh/zsh-common
Normal file
|
@ -0,0 +1,44 @@
|
|||
# Edit the command in editor
|
||||
autoload -z edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey "^X^E" edit-command-line
|
||||
|
||||
#### Aliases
|
||||
# add some color
|
||||
alias grep="grep --color"
|
||||
alias ls="ls --color=auto"
|
||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||
|
||||
# ls shorthand
|
||||
alias ll="ls -h -l"
|
||||
alias l="ls -h -l -A"
|
||||
alias l.="ls -d .*"
|
||||
|
||||
# easy edit
|
||||
alias e=$EDITOR
|
||||
alias v=$VISUAL
|
||||
|
||||
# pager
|
||||
export PAGER="less --quit-if-one-screen"
|
||||
|
||||
# platform-specific config
|
||||
unamestr=$(uname 2> /dev/null)
|
||||
case "$unamestr" in
|
||||
"Darwin")
|
||||
alias ls="ls -G" # macos ls is weird
|
||||
alias o="open"
|
||||
alias cpy="pbcopy"
|
||||
alias pst="pbpaste"
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
;;
|
||||
"Linux")
|
||||
alias o="xdg-open"
|
||||
alias cpy="xclip -selection clipboard"
|
||||
alias pst="xclip -selection clipboard -o"
|
||||
|
||||
# use dircolors, if we have them
|
||||
if [[ -f $HOME/.dir_colors ]]; then
|
||||
eval $(dircolors -b $HOME/.dir_colors)
|
||||
fi
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue