diff options
author | awy <awy@awy.one> | 2024-11-28 17:49:11 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2024-11-28 17:49:11 +0300 |
commit | abeb2dcdf2f2e6ca3ed1836d8cf3d6edf93129f3 (patch) | |
tree | b67df3bfdaeddf4165361899053cb4c74d2681e5 /.config/zsh/.zshrc |
upload
Diffstat (limited to '.config/zsh/.zshrc')
-rw-r--r-- | .config/zsh/.zshrc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc new file mode 100644 index 0000000..a98b25a --- /dev/null +++ b/.config/zsh/.zshrc @@ -0,0 +1,59 @@ +# Enable colors and change prompt: + +autoload -U colors && colors # Load colors +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) +# neovim beam cursor fix +function precmd { print -Pn "\e[ q" } +zstyle ':vcs_info:git:*' formats "[%b]%{$fg[yellow]%}%u" +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' unstagedstr '*' +setopt PROMPT_SUBST +PROMPT='%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$fg[red]%}${vcs_info_msg_0_}%{$reset_color%}$%b ' +setopt autocd # Automatically cd into typed directory. +stty stop undef # Disable ctrl-s to freeze terminal. +setopt interactive_comments + +HISTSIZE=10000000 +SAVEHIST=10000000 +HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history" +setopt append_history +setopt inc_append_history +setopt share_history +setopt hist_ignore_dups +setopt hist_ignore_all_dups +setopt hist_expire_dups_first +setopt hist_find_no_dups +setopt hist_save_no_dups +setopt hist_reduce_blanks +setopt hist_verify +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" + +autoload -U compinit; compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) # Include hidden files. + +source "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" + +lfcd () { + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT + lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} +bindkey -s '^o' '^ulfcd\n' + +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +fi + +export PASSWORD_STORE_CLIP_TIME=5 +# Load syntax highlighting; should be last. +source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null |