.files/.zshrc

62 lines
1.4 KiB
Bash
Raw Normal View History

2020-06-01 14:14:26 +02:00
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/gshipunov/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Edit the command in editor
autoload -z edit-command-line
zle -N edit-command-line
bindkey "^X^E" edit-command-line
2020-06-01 14:14:26 +02:00
# Prompt
if [[ -n $SSH_CONNECTION ]]; then
HOST_LBL="%F{green}[%m]%f"
fi
PROMPT="%B%(?..%F{red}[%?]%f)$HOST_LBL%(!.%F{red}[%n]%f.)%F{cyan}%~%(!.%F{red}.%F{green})%# %f%b"
#### 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=$VISUAL
# 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"
# highlight syntax in zsh
;;
"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