cdotfis-mac/dotfiles/.config/zsh/.zshrc

81 lines
1.9 KiB
Bash

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
HISTSIZE=10000000
SAVEHIST=10000000
HISTFILE=~/.cache/zsh/.histfile
ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&'
export ZSH="/usr/share/oh-my-zsh"
ZSH_CUSTOM="/usr/share"
ZSH_THEME="zsh-theme-powerlevel10k/powerlevel10k"
# CASE_SENSITIVE="true"
# HYPHEN_INSENSITIVE="true"
# DISABLE_MAGIC_FUNCTIONS="true"
# DISABLE_AUTO_TITLE="true"
ENABLE_CORRECTION="true"
# COMPLETION_WAITING_DOTS="true"
# DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(git vi-mode)
export ZSH_COMPDUMP="$XDG_CACHE_HOME"/zsh/zcompdump-"$HOST-$ZSH_VERSION"
source "$ZSH"/oh-my-zsh.sh
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
bindkey -v
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] || [[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
elif [[ ${KEYMAP} == main ]] || [[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] || [[ $1 = 'beam' ]]; then
echo -ne '\e[5 q'
fi
}
zle -N zle-keymap-select
zle-line-init() {
zle -K viins
echo -ne "\e[5 q"
echoti smkx
}
zle -N zle-line-init
echo -ne '\e[5 q'
preexec() { echo -ne '\e[5 q' ;}
export VISUAL="nvim"
autoload -U edit-command-line; zle -N edit-command-line
bindkey '^E' edit-command-line
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end
function zle-line-finish () { echoti rmkx }
zle -N zle-line-finish
source "$ZDOTDIR"/.zshrc_aliases
[[ ! -f ${ZDOTDIR:-~}/.p10k.zsh ]] || source ${ZDOTDIR:-~}/.p10k.zsh
bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n'
bindkey -s '^o' 'xdg-open "$(fzf)"\n'
bracketed-paste() {
zle .$WIDGET && LBUFFER=${LBUFFER%$'\n'}
}
zle -N bracketed-paste