2021-06-15 08:33:52 +00:00
|
|
|
fpath+=$ZDOTDIR/pure
|
|
|
|
|
|
|
|
autoload -U compinit
|
2021-07-06 18:22:18 +00:00
|
|
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' # menu select=2
|
2021-06-15 08:33:52 +00:00
|
|
|
zmodload zsh/complist
|
|
|
|
compinit
|
|
|
|
_comp_options+=(globdots) # Include hidden files.
|
|
|
|
|
|
|
|
# Prompt theme
|
|
|
|
# git clone https://github.com/sindresorhus/pure ~/.config/zsh/
|
|
|
|
autoload -U promptinit; promptinit
|
|
|
|
prompt pure
|
|
|
|
|
|
|
|
# Cursor for vimode
|
|
|
|
# ZLE hooks for prompt's vi mode status
|
|
|
|
function zle-line-init zle-keymap-select {
|
|
|
|
# Change the cursor style depending on keymap mode.
|
|
|
|
case $KEYMAP {
|
|
|
|
vicmd)
|
|
|
|
printf '\e[0 q' # Box.
|
|
|
|
;;
|
|
|
|
|
|
|
|
viins|main)
|
|
|
|
printf '\e[6 q' # Vertical bar.
|
|
|
|
;;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
zle -N zle-line-init
|
|
|
|
zle -N zle-keymap-select
|
|
|
|
|
|
|
|
# Switch between vimode quickly
|
|
|
|
export KEYTIMEOUT=1
|
|
|
|
|
|
|
|
# Alias
|
|
|
|
## Colors
|
|
|
|
alias ls='ls --color'
|
|
|
|
alias grep='grep --color=auto'
|
|
|
|
alias fgrep='fgrep --color=auto'
|
|
|
|
alias egrep='egrep --color=auto'
|
|
|
|
## Prompt when over right
|
|
|
|
alias cp='cp -iv'
|
|
|
|
alias mv='mv -iv'
|
|
|
|
alias rm='rm -i'
|
|
|
|
|
2021-07-06 18:22:18 +00:00
|
|
|
alias newsboat='tmux new -As newsboat newsboat'
|
|
|
|
|
2021-06-15 08:33:52 +00:00
|
|
|
|
|
|
|
# Autosuggestions
|
|
|
|
# git clone https://github.com/zsh-users/zsh-autosuggestions ~/.config/zsh/
|
|
|
|
source ~/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
|
|
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
|
|
|
|
|
|
|
# Syntax Highlight
|
|
|
|
# git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.config/zsh/
|
|
|
|
source ~/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
|
|
|
2021-06-23 19:30:46 +00:00
|
|
|
# Substring search
|
|
|
|
# git clone https://github.com/zsh-users/zsh-history-substring-search ~/.config/zsh
|
|
|
|
source ~/.config/zsh/zsh-history-substring-search/zsh-history-substring-search.zsh
|
|
|
|
|
2021-07-06 18:22:18 +00:00
|
|
|
# Ignore duplicate commands in history
|
|
|
|
setopt HIST_IGNORE_DUPS
|
2021-06-23 19:30:46 +00:00
|
|
|
bindkey '^[[A' history-substring-search-up
|
|
|
|
bindkey '^[[B' history-substring-search-down
|
|
|
|
bindkey -M vicmd 'k' history-substring-search-up
|
|
|
|
bindkey -M vicmd 'j' history-substring-search-down
|
|
|
|
|
2021-06-15 08:33:52 +00:00
|
|
|
# Auto-ls
|
|
|
|
source ~/.config/zsh/auto-ls/auto-ls.zsh
|
|
|
|
|
|
|
|
|
2021-06-17 09:20:59 +00:00
|
|
|
source ~/.config/zsh/completion.zsh
|
|
|
|
source ~/.config/zsh/key-bindings.zsh
|
|
|
|
|
|
|
|
_fzf_complete_pass() {
|
|
|
|
ARGS="$@"
|
|
|
|
_fzf_complete '' "$@" < <(
|
|
|
|
command find ~/.password-store/ -name "*.gpg" | sed -r 's,(.*)\.password-store/(.*)\.gpg,\2,'
|
|
|
|
)
|
|
|
|
}
|
2021-06-15 08:33:52 +00:00
|
|
|
|