# Lines configured by zsh-newuser-install HISTFILE=~/.histfile HISTSIZE=10000 SAVEHIST=10000 setopt autocd extendedglob nomatch notify unsetopt beep bindkey -v # End of lines configured by zsh-newuser-install # The following lines were added by compinstall zstyle ':completion:*' completer _expand _complete _ignored _approximate zstyle ':completion:*' list-colors '' zstyle ':completion:*' menu select=long-list select=0 zstyle ':completion:*' original true zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle :compinstall filename '${HOME}/.zshrc' autoload -Uz compinit compinit # End of lines added by compinstall autoload -U colors colors PROMPT="%{$fg_bold[yellow]%}%* %{$fg_bold[blue]%}%d %(?.$fg_bold[green]✓.$fg_bold[red]%?) %{%(3L.$fg_bold[red]%L .)%}%{%(?.$fg_bold[green].$fg_bold[red])%}%%%{$reset_color%} " source $HOME/.config/.aliases source $HOME/.config/.aliases.local source $HOME/.config/zsh/key-bindings.zsh source $HOME/.config/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh source $HOME/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh bindkey "^[[H" beginning-of-line bindkey "^[[4~" end-of-line bindkey "^[[4h" overwrite-mode bindkey "^[[P" delete-char # save path on cd (chpwd is a zsh hook) and spawned subshell function chpwd { pwd > ~/.last_dir } if [[ $SHLVL -ge 3 ]]; then chpwd fi # restore last saved path on launch if [[ -f ~/.last_dir ]]; then cd $(cat ~/.last_dir) fi # save path on quiting nnn (and alias it to 'n') function n { # Block nesting of nnn in subshells if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then echo "nnn is already running" return fi # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) # To cd on quit only on ^G, remove the "export" as in: # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" # NOTE: NNN_TMPFILE is fixed, should not be modified export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn # stty start undef # stty stop undef # stty lwrap undef # stty lnext undef nnn "$@" if [ -f "$NNN_TMPFILE" ]; then . "$NNN_TMPFILE" rm -f "$NNN_TMPFILE" > /dev/null fi } # cd to $PWD of exited subshell in nnn function nnn_cd { if ! [ -z "$NNN_PIPE" ]; then printf "%s\0" "0c${PWD}" > "${NNN_PIPE}" !& fi } trap nnn_cd EXIT eval `keychain --eval --quiet --agents ssh,gpg id_rsa`