# Suleyman's zsh interactive shell config at "https://git.farajli.net/slcf" PROMPT="%B%F{red}%(?..%? )%B%F{blue}%n%b%f@%m %B%~ %% %b" # Git integration autoload -Uz vcs_info precmd_vcs_info() { vcs_info } precmd_functions+=( precmd_vcs_info ) setopt prompt_subst RPROMPT='%B${vcs_info_msg_0_}' zstyle ':vcs_info:git:*' formats '%b' # History file HISTSIZE=1000000000 SAVEHIST=1000000000 HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history" # Basic tab complete: autoload -U compinit zstyle ':completion:*' menu select zmodload zsh/complist compinit _comp_options+=(globdots) # Include hidden files. # vi mode bindkey -v # Vi mode. export KEYTIMEOUT=1 # Set escape delay to 0.01 sec. # Use vim keys in tab complete menu: bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'k' vi-up-line-or-history bindkey -M menuselect 'l' vi-forward-char bindkey -M menuselect 'j' vi-down-line-or-history bindkey -v '^?' backward-delete-char # Change cursor shape for different vi modes. function zle-keymap-select () { case "${KEYMAP}" in vicmd) echo -ne '\e[1 q';; # block viins|main) echo -ne '\e[5 q';; # beam esac } zle -N zle-keymap-select zle-line-init() { zle -K viins echo -ne "\e[5 q" } zle -N zle-line-init echo -ne '\e[5 q' # Use beam shape cursor on startup. preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. # Options setopt autocd # Automatically cd into typed directory. stty stop undef # Disable ctrl-s to freeze terminal. setopt interactive_comments unsetopt nomatch setopt INC_APPEND_HISTORY # Add commands to history when they are run. setopt HIST_FIND_NO_DUPS # Don't show duplicate commands when backward searching. # Custom keybinds bindkey '^R' history-incremental-search-backward bindkey -s '^o' '^ulfcd\n' bindkey -s '^f' '^ucd "$(dirname "$(fzf --reverse)")"\n' bindkey -s '^v' '^uvi "$(fzf --reverse)"\n' if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ];then source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" fi if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" ];then source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" fi