2021-12-07 16:53:57 +00:00
|
|
|
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
|
|
|
|
autoload -Uz _zinit
|
|
|
|
(( ${+_comps} )) && _comps[zinit]=_zinit
|
|
|
|
|
2020-02-18 10:26:51 +00:00
|
|
|
stty -ixon # Disable ctrl-s and ctrl-q.
|
|
|
|
|
2020-04-21 01:05:16 +00:00
|
|
|
# ssh-agent
|
|
|
|
start_ssh_agent() {
|
|
|
|
ssh-agent | grep -v \^echo > "$SSH_ENV"
|
|
|
|
chmod 1600 "$SSH_ENV"
|
|
|
|
}
|
|
|
|
|
|
|
|
SSH_ENV="/tmp/.ssh_env.$USER"
|
|
|
|
if [ -f "$SSH_ENV" ]; then
|
|
|
|
. "$SSH_ENV"
|
|
|
|
ps q $SSH_AGENT_PID > /dev/null || start_ssh_agent
|
|
|
|
else
|
|
|
|
start_ssh_agent
|
|
|
|
fi
|
|
|
|
. "$SSH_ENV"
|
|
|
|
|
2019-01-11 18:13:34 +00:00
|
|
|
# load modules
|
2019-01-11 20:10:03 +00:00
|
|
|
bgnotify_threshold=0
|
2019-01-11 19:59:58 +00:00
|
|
|
|
2021-03-26 12:01:24 +00:00
|
|
|
|
2021-12-07 16:53:57 +00:00
|
|
|
zinit light zsh-users/zsh-completions
|
2021-12-22 01:40:33 +00:00
|
|
|
zinit light Aloxaf/fzf-tab
|
2021-12-07 16:53:57 +00:00
|
|
|
zinit light zsh-users/zsh-autosuggestions
|
2022-01-08 16:27:40 +00:00
|
|
|
zinit light jeffreytse/zsh-vi-mode
|
2021-12-07 16:53:57 +00:00
|
|
|
|
|
|
|
zinit ice wait lucid
|
|
|
|
zinit light zdharma-continuum/fast-syntax-highlighting
|
|
|
|
|
|
|
|
zinit ice wait"1" lucid
|
|
|
|
zinit light Tarrasch/zsh-autoenv
|
2020-04-21 02:28:26 +00:00
|
|
|
|
2021-12-07 16:53:57 +00:00
|
|
|
zinit ice wait"5" lucid
|
|
|
|
zinit light t413/zsh-background-notify.git
|
|
|
|
|
|
|
|
zinit ice wait"1" lucid
|
|
|
|
zinit light chisui/zsh-nix-shell
|
|
|
|
|
|
|
|
zinit snippet OMZL::spectrum.zsh
|
2021-12-09 20:23:54 +00:00
|
|
|
# zinit snippet OMZP::history-substring-search/history-substring-search.zsh
|
2021-12-14 23:01:32 +00:00
|
|
|
zinit snippet https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh
|
2021-12-07 16:53:57 +00:00
|
|
|
zinit snippet https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh
|
2021-12-09 20:23:54 +00:00
|
|
|
zinit ice wait"1" lucid
|
|
|
|
zinit snippet https://raw.githubusercontent.com/hkbakke/bash-insulter/master/src/bash.command-not-found
|
2021-12-07 16:53:57 +00:00
|
|
|
|
2021-12-09 20:23:54 +00:00
|
|
|
# bindkey '^[[A' history-substring-search-up
|
|
|
|
# bindkey '^[[B' history-substring-search-down
|
2019-01-11 19:59:58 +00:00
|
|
|
|
2019-05-26 15:03:46 +00:00
|
|
|
# vi key bindings
|
|
|
|
set -o vi
|
2018-02-01 22:34:24 +00:00
|
|
|
|
|
|
|
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
|
|
|
|
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**'
|
|
|
|
zstyle ':completion:*' max-errors 2
|
|
|
|
zstyle ':completion:*' menu select=1
|
2019-06-26 21:59:48 +00:00
|
|
|
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle :compinstall filename "${HOME}/.zshrc" zstyle ':completion:*' rehash true
|
2018-02-01 22:34:24 +00:00
|
|
|
|
2018-05-19 17:39:06 +00:00
|
|
|
[[ $UID -eq 0 ]] || () {
|
|
|
|
local i
|
|
|
|
local -T SUDO_PATH sudo_path
|
|
|
|
local -U sudo_path
|
|
|
|
sudo_path=($path {,/usr{,/local}}/sbin(N-/))
|
2019-06-26 22:10:41 +00:00
|
|
|
for i in sudo{,x} su{,x} doas{,x}
|
2018-05-19 17:39:06 +00:00
|
|
|
do zstyle ":completion:*:$i:*" environ PATH="$SUDO_PATH"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
zstyle ':completion::complete:*' use-cache 1
|
2019-08-25 09:49:08 +00:00
|
|
|
export HISTFILE=~/.histfile
|
|
|
|
export HISTSIZE=10000
|
|
|
|
export SAVEHIST=10000
|
|
|
|
setopt appendhistory autocd notify histexpiredupsfirst histsavenodups incappendhistorytime histnostore histignorespace
|
2018-02-01 22:34:24 +00:00
|
|
|
unsetopt beep
|
|
|
|
bindkey -e
|
|
|
|
|
2021-04-05 20:49:45 +00:00
|
|
|
export NIX_BUILD_SHELL=zsh
|
2020-06-19 12:06:47 +00:00
|
|
|
|
2019-08-14 15:51:50 +00:00
|
|
|
# vi mode
|
|
|
|
bindkey -v
|
|
|
|
export KEYTIMEOUT=1
|
|
|
|
|
2018-12-29 18:14:14 +00:00
|
|
|
# Prompt
|
|
|
|
autoload -U colors && colors
|
|
|
|
PROMPT="%B%{$FG[081]%}%n%{$reset_color%}%b%{$FG[245]%}@%{$reset_color%}%B%{$FG[206]%}%m%{$reset_color%}%b %{$fg[245]%}%B%c%b %(!.%{$FG[001]%}#.%{$FG[081]%}$)%{$reset_color%} "
|
|
|
|
|
2019-06-26 21:59:48 +00:00
|
|
|
export FZF_DEFAULT_OPTS="-m --no-mouse"
|
2021-04-08 01:09:09 +00:00
|
|
|
export FZF_DEFAULT_COMMAND="fd"
|
2018-12-31 02:06:48 +00:00
|
|
|
|
2018-02-02 16:12:44 +00:00
|
|
|
alias dots="git --git-dir=$HOME/.dots --work-tree=$HOME"
|
2019-06-26 21:59:48 +00:00
|
|
|
alias dotmodules="dots submodule update --recursive --remote"
|
2021-04-05 21:30:23 +00:00
|
|
|
alias dotupdate="dots pull && vi --headless -c 'call ConfUpdate()'"
|
2021-02-28 15:55:31 +00:00
|
|
|
alias venv="source ~/.venvs/venv/bin/activate"
|
2018-09-10 10:25:43 +00:00
|
|
|
alias top="htop"
|
2021-12-08 18:46:06 +00:00
|
|
|
alias ytdl="yt-dlp"
|
2021-04-08 01:22:34 +00:00
|
|
|
alias ag="ag --nogroup"
|
2019-05-02 00:25:22 +00:00
|
|
|
|
2020-01-30 20:05:57 +00:00
|
|
|
alias s="vi ~/.local/bin/\$(stest -lx ~/.local/bin | fzf --tac -e)"
|
2019-05-02 00:25:22 +00:00
|
|
|
|
2020-01-19 10:11:28 +00:00
|
|
|
alias ffmpeg="ffmpeg -hide_banner"
|
2020-04-04 00:50:38 +00:00
|
|
|
alias ffprobe="ffprobe -hide_banner"
|
2020-01-19 10:11:28 +00:00
|
|
|
|
2019-08-21 19:16:53 +00:00
|
|
|
[ -f ~/.local_env ] && . ~/.local_env
|
2018-12-31 14:43:18 +00:00
|
|
|
[ -f ~/.zshrc.local ] && . ~/.zshrc.local
|
2019-06-23 16:49:02 +00:00
|
|
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
2021-12-07 16:53:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
autoload -Uz compinit && compinit
|
|
|
|
autoload -U +X bashcompinit && bashcompinit && complete -o bashdefault -o default -o nospace -C qpdf qpdf
|
|
|
|
|
|
|
|
zinit cdreplay -q
|