117 lines
3.6 KiB
Bash
117 lines
3.6 KiB
Bash
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
|
# Initialization code that may require console input (password prompts, [y/n]
|
|
# confirmations, etc.) must go above this block; everything else may go below.
|
|
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
|
|
|
|
ZSH_DISABLE_COMPFIX=true
|
|
|
|
# completion styling
|
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
|
zstyle ':completion:*' menu no
|
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
|
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-prewview 'ls --color $realpath'
|
|
|
|
# bindings
|
|
bindkey -e
|
|
bindkey "^p" history-search-backward
|
|
bindkey "^n" history-search-forward
|
|
|
|
# history
|
|
HISTSIZE=50000
|
|
HISTFILE=~/.zsh_history
|
|
SAVEHIST=$HISTSIZE
|
|
HISTDUP=erase
|
|
setopt appendhistory
|
|
setopt sharehistory
|
|
setopt hist_ignore_space
|
|
setopt hist_ignore_all_dups
|
|
setopt hist_save_no_dups
|
|
setopt hist_ignore_dups
|
|
setopt hist_find_no_dups
|
|
|
|
alias vi=nvim
|
|
alias vim=nvim
|
|
alias t=tmux
|
|
alias se=sudoedit
|
|
alias s=sudo
|
|
alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'
|
|
alias cz=chezmoi
|
|
|
|
export PATH=$PATH:/home/yt/.cargo/bin
|
|
|
|
source <(fzf --zsh)
|
|
export FZF_BASE=/usr/bin
|
|
export FZF_DEFAULT_COMMAND=rg
|
|
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
|
|
--highlight-line \
|
|
--info=inline-right \
|
|
--ansi \
|
|
--layout=reverse \
|
|
--border=none
|
|
--color=bg+:#283457 \
|
|
--color=bg:#16161e \
|
|
--color=border:#27a1b9 \
|
|
--color=fg:#c0caf5 \
|
|
--color=gutter:#16161e \
|
|
--color=header:#ff9e64 \
|
|
--color=hl+:#2ac3de \
|
|
--color=hl:#2ac3de \
|
|
--color=info:#545c7e \
|
|
--color=marker:#ff007c \
|
|
--color=pointer:#ff007c \
|
|
--color=prompt:#2ac3de \
|
|
--color=query:#c0caf5:regular \
|
|
--color=scrollbar:#27a1b9 \
|
|
--color=separator:#ff9e64 \
|
|
--color=spinner:#ff007c \
|
|
"
|
|
|
|
eval "$(zoxide init --cmd cd zsh)"
|
|
|
|
export NVM_DIR="$HOME/.config/nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
|
|
### Added by Zinit's installer
|
|
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
|
|
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
|
|
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
|
|
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
|
|
print -P "%F{33} %F{34}Installation successful.%f%b" || \
|
|
print -P "%F{160} The clone has failed.%f%b"
|
|
fi
|
|
|
|
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
|
|
autoload -Uz _zinit
|
|
(( ${+_comps} )) && _comps[zinit]=_zinit
|
|
|
|
# Load a few important annexes, without Turbo
|
|
# (this is currently required for annexes)
|
|
zinit light-mode for \
|
|
zdharma-continuum/zinit-annex-as-monitor \
|
|
zdharma-continuum/zinit-annex-bin-gem-node \
|
|
zdharma-continuum/zinit-annex-patch-dl \
|
|
zdharma-continuum/zinit-annex-rust
|
|
|
|
### End of Zinit's installer chunk
|
|
|
|
# plugins
|
|
zinit ice depth=1; zinit light romkatv/powerlevel10k
|
|
zinit light zsh-users/zsh-syntax-highlighting
|
|
zinit light zsh-users/zsh-completions
|
|
zinit light zsh-users/zsh-autosuggestions
|
|
zinit light Aloxaf/fzf-tab
|
|
zinit snippet OMZP::git
|
|
zinit snippet OMZP::sudo
|
|
zinit snippet OMZP::archlinux
|
|
zinit snippet OMZP::command-not-found
|
|
|
|
# load completions
|
|
autoload -U compinit && compinit
|
|
|
|
zinit cdreplay -q
|
|
|
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|