diff --git a/zsh/completion.zsh b/zsh/completion.zsh new file mode 100644 index 0000000..e9ba3c2 --- /dev/null +++ b/zsh/completion.zsh @@ -0,0 +1,29 @@ +# Completion System +autoload -U compinit +compinit -i + +# URL magic +autoload -U url-quote-magic +zle -N self-insert url-quote-magic + +# Show completion menu on succesive tab press +setopt COMPLETE_ALIASES +setopt ALWAYS_TO_END +setopt AUTO_MENU +setopt COMPLETE_IN_WORD + +# color code completion +zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31" + +# If no match is found, pass the string on to the command +setopt nonomatch + +# Enable menu selection +zstyle ':completion:*' menu select + +# Enable case insensitive and backwards completion +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +# Completion caching +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache diff --git a/zsh/completion.zsh b/zsh/completion.zsh new file mode 100644 index 0000000..e9ba3c2 --- /dev/null +++ b/zsh/completion.zsh @@ -0,0 +1,29 @@ +# Completion System +autoload -U compinit +compinit -i + +# URL magic +autoload -U url-quote-magic +zle -N self-insert url-quote-magic + +# Show completion menu on succesive tab press +setopt COMPLETE_ALIASES +setopt ALWAYS_TO_END +setopt AUTO_MENU +setopt COMPLETE_IN_WORD + +# color code completion +zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31" + +# If no match is found, pass the string on to the command +setopt nonomatch + +# Enable menu selection +zstyle ':completion:*' menu select + +# Enable case insensitive and backwards completion +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +# Completion caching +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index dc442fd..46f4db1 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -13,7 +13,7 @@ local color=green fi - echo "%{%F{$color}%} $(__git_ps1 "%s")" + echo "%{%F{$color}%}  $(__git_ps1 "%s")" else echo "" fi @@ -25,10 +25,10 @@ zle reset-prompt } PROMPT_EC='%(?.%{%F{green}%}.%{%F{red}%})%?' -PROMPT_USER='%{%F{magenta}%}%n ' -PROMPT_DIR='%{%F{blue}%}%~% ' +PROMPT_USER='%{%F{magenta}%}%n' +PROMPT_DIR='%{%F{blue}%}%~%' PROMPT_SU='%{%f%k%b%}%(!.%{%F{red}%}# %{%k%F{black}%})' PROMPT='%{%f%b%k%} $PROMPT_EC $PROMPT_USER $PROMPT_DIR $(_git_info) -%{%f%k%b%}❯ ' +%{%f%k%b%}▸ ' diff --git a/zsh/completion.zsh b/zsh/completion.zsh new file mode 100644 index 0000000..e9ba3c2 --- /dev/null +++ b/zsh/completion.zsh @@ -0,0 +1,29 @@ +# Completion System +autoload -U compinit +compinit -i + +# URL magic +autoload -U url-quote-magic +zle -N self-insert url-quote-magic + +# Show completion menu on succesive tab press +setopt COMPLETE_ALIASES +setopt ALWAYS_TO_END +setopt AUTO_MENU +setopt COMPLETE_IN_WORD + +# color code completion +zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31" + +# If no match is found, pass the string on to the command +setopt nonomatch + +# Enable menu selection +zstyle ':completion:*' menu select + +# Enable case insensitive and backwards completion +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +# Completion caching +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index dc442fd..46f4db1 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -13,7 +13,7 @@ local color=green fi - echo "%{%F{$color}%} $(__git_ps1 "%s")" + echo "%{%F{$color}%}  $(__git_ps1 "%s")" else echo "" fi @@ -25,10 +25,10 @@ zle reset-prompt } PROMPT_EC='%(?.%{%F{green}%}.%{%F{red}%})%?' -PROMPT_USER='%{%F{magenta}%}%n ' -PROMPT_DIR='%{%F{blue}%}%~% ' +PROMPT_USER='%{%F{magenta}%}%n' +PROMPT_DIR='%{%F{blue}%}%~%' PROMPT_SU='%{%f%k%b%}%(!.%{%F{red}%}# %{%k%F{black}%})' PROMPT='%{%f%b%k%} $PROMPT_EC $PROMPT_USER $PROMPT_DIR $(_git_info) -%{%f%k%b%}❯ ' +%{%f%k%b%}▸ ' diff --git a/zsh/zshrc.symlink b/zsh/zshrc.symlink index cde79c4..2105e5b 100644 --- a/zsh/zshrc.symlink +++ b/zsh/zshrc.symlink @@ -16,11 +16,6 @@ source $DOTFILES/git/git-prompt.sh source $DOTFILES/git/git-completion.zsh &>/dev/null -# Init autocomplete -autoload -U compinit -compinit -zstyle ':completion:*' menu select - # History HISTFILE=~/.zsh_history HISTSIZE=10000 @@ -30,14 +25,35 @@ setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_ALL_DUPS setopt APPEND_HISTORY +setopt INC_APPEND_HISTORY setopt HIST_REDUCE_BLANKS setopt HIST_IGNORE_SPACE setopt HIST_NO_STORE +setopt HIST_VERIFY +setopt EXTENDED_HISTORY -setopt COMPLETE_ALIASES +# Globbing +setopt GLOBDOTS +setopt EXTENDEDGLOB -# color code completion -zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31" + +# CD +setopt AUTO_CD +setopt AUTO_PUSHD +setopt CDABLE_VARS + +# IO +setopt CORRECT + +# Prompting +setopt PROMPT_SUBST + +# Scripts and Functions +setopt MULTIOS + +# zmv +autoload -U zmv +alias mmv="noglob zmv" # Vi mode bindkey -v