summaryrefslogtreecommitdiff
path: root/config/essentials/zsh/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'config/essentials/zsh/.zshrc')
-rw-r--r--config/essentials/zsh/.zshrc49
1 files changed, 46 insertions, 3 deletions
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc
index 76ff87f..c590d54 100644
--- a/config/essentials/zsh/.zshrc
+++ b/config/essentials/zsh/.zshrc
@@ -15,13 +15,56 @@ autoload -U select-word-style
autoload -z edit-command-line
zle -N edit-command-line
zstyle ':compinstall' filename '/home/aluc/.zshrc'
+
+### Completion
+# cache
+zstyle ':completion:*' use-cache on
+zstyle ':completion:*' cache-path "$ZDOTDIR/zcompcache"
+
+# completers
+zstyle ':completion:*' completer _extensions _complete
+
+# format
+zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D%d --%f'
+zstyle ':completion:*:*:*:*:messages' format '%F{purple}-- %d --%f'
+zstyle ':completion:*:*:*:*:warnings' format '%F{red}-- no matches found --%f'
+zstyle ':completion:*:default' list-prompt '%S%M matches%s'
+# show a 'ls -a' like outptut when listing files
+zstyle ':completion:*:*:*:*:default' list-colors ${(s.:.)LS_COLORS}
+
+# Group completions by categories
+zstyle ':completion:*' group-name ''
+zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands
+
+zstyle ':completion:*' squeeze-slashes true
+
+# Prefer completing for an option (think cd -)
+zstyle ':completion:*' complete-options true
+
+# keep prefix when completing
+zstyle ':completion:*' keep-prefix true
+
+# ui
zstyle ':completion:*' menu select
-autoload -Uz compinit
+# Move around using h j k l in completion menu
+zmodload zsh/complist
+bindkey -M menuselect 'h' vi-backward-char
+bindkey -M menuselect 'k' vi-up-line-or-history
+bindkey -M menuselect 'j' vi-down-line-or-history
+bindkey -M menuselect 'l' vi-forward-char
+bindkey -M menuselect '^xg' clear-screen
+# interactive mode
+bindkey -M menuselect '^xi' vi-insert
+bindkey -M menuselect '^xh' accept-and-hold # Hold
+bindkey -M menuselect '^xn' accept-and-infer-next-history # Next
+bindkey -M menuselect '^xu' undo # Undo
+
+autoload -Uz compinit; compinit
+
autoload -Uz surround
zle -N delete-surround surround
zle -N add-surround surround
zle -N change-surround surround
-compinit
# Source files
. $ZDOTDIR/functions.zsh
@@ -110,7 +153,7 @@ command_not_found_handler () {
}
# prompt
-PS1=' %B%(#.%F{1}.%F{13})[%n%b%f@%B%F{6}%m]%b%f %3~ '
+PS1=' %B%(#.%F{1}.%F{13})%n%b%f@%B%F{6}%m%b%f %3~ '
RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(parse_git_branch)%f%(?.. %?)'
setopt prompt_subst