# .zshrc [2] Used for setting user's interactive shell configuration and # executing commands, will be sourced when starting as an interactive shell. # Load plugin scripts plugin-load() { source ~/.config/zsh/$1/$1.plugin.zsh } plugin-load zsh-syntax-highlighting plugin-load zsh-history-substring-search # Disable sound unsetopt BEEP # Remove duplicates from history setopt HIST_IGNORE_ALL_DUPS setopt HIST_REDUCE_BLANKS setopt HIST_SAVE_NO_DUPS # Enable multi-terminal history setopt INC_APPEND_HISTORY # Enable % escape expansion and substitution in the prompt setopt PROMPT_PERCENT setopt PROMPT_SUBST # Disable 'D' to logout setopt IGNORE_EOF # Enable comments in the prompt setopt INTERACTIVE_COMMENTS # Initialize completions autoload -U compinit compinit # Enable prompt themes autoload -Uz promptinit promptinit prompt fresh # Enable vi mode bindkey -v # Enable yank whole line with 'yy' and yank end of line with 'Y' bindkey -M vicmd 'yy' vi-yank-whole-line bindkey -M vicmd 'Y' vi-yank-eol # Enable undo with 'u' and redo with 'U' bindkey -M vicmd 'u' undo bindkey -M vicmd 'U' redo # Enable substring history search with 'j' and 'k' bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'j' history-substring-search-down # Replace 'h' with 'K' to view help bindkey -r '^[h' bindkey -M vicmd 'K' run-help # Disable Ex mode with ':' bindkey -rM vicmd ':' # Use editor to edit command line with 'V' autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd '^V' edit-command-line # Disable tty flow control, allows vim to use 'S' stty -ixon # Remove duplicates from PATH typeset -U PATH # Aliases alias grep='grep --color=always' alias cninja='cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMNADS=ON' alias ssh='TERM=xterm-256color ssh' case `uname` in Linux) [ "$TMUX" = "" ] && \ alias cls="printf '\ec'" || alias cls="clear && printf '\e[3J'" alias ls='ls -F --colour=auto' alias debug='cgdb --args' ;; Darwin) alias cls="clear && printf '\e[3J'" alias ls='ls -GFh' alias debug='lldb --' ;; esac if [ "$TMUX" != "" ]; then alias sp='tmux split-window' alias vs='tmux split-window -h' fi