86 lines
1.9 KiB
Bash
86 lines
1.9 KiB
Bash
export PATH=$HOME/go/bin:$HOME/.local/bin:$HOME/.cargo/bin:$PATH
|
|
if which ruby >/dev/null && which gem >/dev/null; then
|
|
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
|
|
fi
|
|
|
|
eval $(thefuck --alias)
|
|
|
|
autoload -Uz vcs_info
|
|
|
|
export EDITOR="nvim"
|
|
alias vim=nvim
|
|
alias ls='ls --color=auto'
|
|
|
|
precmd_vcs_info() {
|
|
vcs_info
|
|
}
|
|
precmd_functions+=(precmd_vcs_info)
|
|
|
|
zstyle ':vcs_info:git:*' formats '%F{245}%b %m%u%c%f '
|
|
zstyle ':vcs_info:*' enable git
|
|
setopt prompt_subst
|
|
|
|
if [ "$SSH_CONNECTION" ]; then
|
|
PROMPT_HOST="%F{yellow}[ssh] $HOST%f "
|
|
fi
|
|
|
|
function ret {
|
|
case $? in
|
|
0) ;;
|
|
126) echo "%F{red}[PERMISSION]%f " ;;
|
|
127) echo "%F{red}[NOTFOUND]%f " ;;
|
|
<129-254>) echo "%F{red}[SIG$(kill -l $(($? - 127)))]%f " ;;
|
|
*) echo "%F{red}$?%f " ;;
|
|
esac
|
|
}
|
|
export PROMPT='$PROMPT_HOST$(ret)%f%20<…<%~%<<$(pretty-git-prompt) %F{117}>%f '
|
|
|
|
HISTSIZE=20000
|
|
HISTFILE=~/.zsh_history
|
|
SAVEHIST=20000
|
|
HISTDUP=erase
|
|
setopt appendhistory
|
|
setopt sharehistory
|
|
setopt incappendhistory
|
|
|
|
bindkey -v
|
|
bindkey '^[[H' beginning-of-line
|
|
bindkey '^[[F' end-of-line
|
|
bindkey '^R' history-incremental-search-backward
|
|
KEYTIMEOUT=1
|
|
|
|
function zle-keymap-select zle-line-init {
|
|
case $KEYMAP in
|
|
vicmd) print -n -- "\E]50;CursorShape=0\C-G";; # block cursor
|
|
viins|main) print -n -- "\E]50;CursorShape=1\C-G";; # line cursor
|
|
esac
|
|
|
|
zle reset-prompt
|
|
zle -R
|
|
}
|
|
|
|
function zle-line-finish {
|
|
print -n -- "\E]50;CursorShape=0\C-G" # block cursor
|
|
}
|
|
|
|
zle -N zle-line-init
|
|
zle -N zle-line-finish
|
|
zle -N zle-keymap-select
|
|
|
|
setopt autocd menucomplete
|
|
|
|
first-tab() {
|
|
if [[ $#BUFFER == 0 ]]; then
|
|
BUFFER="cd "
|
|
CURSOR=3
|
|
zle list-choices
|
|
else
|
|
zle expand-or-complete
|
|
fi
|
|
}
|
|
zle -N first-tab
|
|
bindkey '^I' first-tab
|
|
zstyle ':completion:*' menu select
|
|
|
|
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|