2021-01-03 19:03:48 +01:00
|
|
|
|
setopt autocd # change directory just by typing its name
|
|
|
|
|
#setopt correct # auto correct mistakes
|
|
|
|
|
setopt interactivecomments # allow comments in interactive mode
|
|
|
|
|
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’
|
|
|
|
|
setopt nonomatch # hide error message if there is no match for the pattern
|
|
|
|
|
setopt notify # report the status of background jobs immediately
|
|
|
|
|
setopt numericglobsort # sort filenames numerically when it makes sense
|
|
|
|
|
setopt promptsubst # enable command substitution in prompt
|
|
|
|
|
|
|
|
|
|
WORDCHARS=${WORDCHARS//\/} # Don't consider certain characters part of the word
|
|
|
|
|
|
|
|
|
|
# hide EOL sign ('%')
|
|
|
|
|
PROMPT_EOL_MARK=""
|
|
|
|
|
|
|
|
|
|
# configure key keybindings
|
|
|
|
|
bindkey -e # emacs key bindings
|
2020-12-03 01:59:46 +01:00
|
|
|
|
|
2021-01-03 19:03:48 +01:00
|
|
|
|
# enable completion features
|
2020-12-03 01:59:46 +01:00
|
|
|
|
autoload -Uz compinit
|
2021-01-03 19:03:48 +01:00
|
|
|
|
compinit -d ~/.cache/zcompdump
|
|
|
|
|
zstyle ':completion:*:*:*:*:*' menu select
|
|
|
|
|
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # case insensitive tab completion
|
|
|
|
|
|
|
|
|
|
# History configurations
|
|
|
|
|
HISTFILE=~/.zsh_history
|
|
|
|
|
HISTSIZE=1000
|
|
|
|
|
SAVEHIST=2000
|
|
|
|
|
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
|
|
|
|
|
setopt hist_ignore_dups # ignore duplicated commands history list
|
|
|
|
|
setopt hist_ignore_space # ignore commands that start with space
|
|
|
|
|
setopt hist_verify # show command with history expansion to user before running it
|
|
|
|
|
#setopt share_history # share command history data
|
|
|
|
|
|
|
|
|
|
# force zsh to show the complete history
|
|
|
|
|
alias history="history 0"
|
|
|
|
|
|
|
|
|
|
# make less more friendly for non-text input files, see lesspipe(1)
|
|
|
|
|
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
|
|
|
|
|
|
|
|
# Prompt
|
|
|
|
|
[[ $- = *i* ]] && source $HOME/.liquidprompt
|
|
|
|
|
|
|
|
|
|
# enable color support of ls, less and man, and also add handy aliases
|
|
|
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
|
|
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
|
|
|
alias ls='ls --color=auto'
|
|
|
|
|
#alias dir='dir --color=auto'
|
|
|
|
|
#alias vdir='vdir --color=auto'
|
|
|
|
|
|
|
|
|
|
alias grep='grep --color=auto'
|
|
|
|
|
alias fgrep='fgrep --color=auto'
|
|
|
|
|
alias egrep='egrep --color=auto'
|
|
|
|
|
alias diff='diff --color=auto'
|
|
|
|
|
alias ip='ip --color=auto'
|
|
|
|
|
|
|
|
|
|
export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink
|
|
|
|
|
export LESS_TERMCAP_md=$'\E[1;36m' # begin bold
|
|
|
|
|
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink
|
|
|
|
|
export LESS_TERMCAP_so=$'\E[01;33m' # begin reverse video
|
|
|
|
|
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video
|
|
|
|
|
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline
|
|
|
|
|
export LESS_TERMCAP_ue=$'\E[0m' # reset underline
|
|
|
|
|
|
|
|
|
|
# Take advantage of $LS_COLORS for completion as well
|
|
|
|
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# enable auto-suggestions based on the history
|
|
|
|
|
if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
|
|
|
|
|
. /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
|
|
|
# change suggestion color
|
|
|
|
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#999'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# enable syntax highlighting
|
|
|
|
|
if [ -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
|
|
|
|
|
. /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
|
|
|
fi
|
2020-12-03 01:59:46 +01:00
|
|
|
|
|
|
|
|
|
# pager
|
|
|
|
|
export PAGER="less --quit-if-one-screen"
|
|
|
|
|
|
2020-06-01 20:33:58 +02:00
|
|
|
|
# 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
|
|
|
|
#### 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
|
2020-09-08 13:15:46 +02:00
|
|
|
|
alias e=$EDITOR
|
|
|
|
|
alias v=$VISUAL
|
2020-06-01 14:14:26 +02:00
|
|
|
|
|
|
|
|
|
# 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"
|
2020-12-13 22:15:40 +01:00
|
|
|
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
2020-06-01 14:14:26 +02:00
|
|
|
|
;;
|
|
|
|
|
"Linux")
|
|
|
|
|
alias o="xdg-open"
|
2020-12-13 22:22:52 +01:00
|
|
|
|
alias cpy="wl-copy"
|
|
|
|
|
alias pst="wl-paste"
|
|
|
|
|
alias xcpy="xclip -selection clipboard"
|
|
|
|
|
alias xpst="xclip -selection clipboard -o"
|
2020-06-01 14:14:26 +02:00
|
|
|
|
;;
|
|
|
|
|
esac
|
2021-01-03 19:03:48 +01:00
|
|
|
|
|
|
|
|
|
# hook in direnv, if it installed
|
2021-01-08 19:16:43 +01:00
|
|
|
|
if type "direnv" > /dev/null; then
|
2021-01-03 19:03:48 +01:00
|
|
|
|
eval "$(direnv hook zsh)"
|
|
|
|
|
fi
|
2021-01-04 05:35:57 +01:00
|
|
|
|
|
2021-01-03 19:03:48 +01:00
|
|
|
|
if [ -e /home/gshipunov/.nix-profile/etc/profile.d/nix.sh ]; then . /home/gshipunov/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
|