dotfiles/zsh/.config/zsh/.zshrc

100 lines
2.4 KiB
Bash
Raw Permalink Normal View History

2021-07-13 05:12:48 +00:00
fpath+=$ZDOTDIR/pure
2023-06-07 04:40:39 +00:00
fpath+=$ZDOTDIR/zfunc
2021-07-13 05:12:48 +00:00
autoload -U compinit
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' # menu select=2
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
2022-03-03 05:23:06 +00:00
export PURE_PROMPT_SYMBOL='%f%n%f%F{magenta}'
2021-07-13 05:12:48 +00:00
# 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'
2022-10-04 07:48:14 +00:00
alias cat='bat -pp'
alias less='bat -p'
2021-07-13 05:12:48 +00:00
2022-11-10 03:26:38 +00:00
# Newsboat
2021-07-13 05:12:48 +00:00
alias newsboat='tmux new -As newsboat newsboat'
# 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
# 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
# Ignore duplicate commands in history
setopt HIST_IGNORE_DUPS
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
# Auto-ls
source ~/.config/zsh/auto-ls/auto-ls.zsh
2022-02-02 09:17:05 +00:00
# Pyenv
eval "$(pyenv init --path)"
2021-07-13 05:12:48 +00:00
source ~/.config/zsh/completion.zsh
source ~/.config/zsh/key-bindings.zsh
2022-11-10 03:26:38 +00:00
# password-store
2021-07-13 05:12:48 +00:00
_fzf_complete_pass() {
ARGS="$@"
_fzf_complete '' "$@" < <(
command find ~/.password-store/ -name "*.gpg" | sed -r 's,(.*)\.password-store/(.*)\.gpg,\2,'
)
}
2023-06-07 04:40:39 +00:00
# yarn global commands
export PATH="$(yarn global bin):$PATH"
2022-11-21 08:55:20 +00:00
# zk
export ZK_NOTEBOOK_DIR="/home/lafrite/Nextcloud/Documents/zettelkasten/"
2023-06-23 09:08:10 +00:00
# tea
PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/lafrite/.config/tea/autocomplete.zsh"