aboutsummaryrefslogtreecommitdiff
path: root/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc14
1 files changed, 11 insertions, 3 deletions
diff --git a/.zshrc b/.zshrc
index 9e19ed6..4ba1181 100644
--- a/.zshrc
+++ b/.zshrc
@@ -14,11 +14,19 @@ zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' special-dirs true
-setopt auto_menu
+setopt auto_menu # show completion menu when spamming <tab>
setopt complete_in_word
-setopt always_to_end
+setopt always_to_end # move cursor to end of word after completion
+setopt auto_cd # cd if the command is a valid path
+WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS
compinit -d "$ZSH_COMPDUMP"
+# history
+export HISTFILE="$XDG_DATA_HOME/zsh/history"
+export HISTSIZE=10000000
+export SAVEHIST=10000000
+setopt share_history
+
# keybinds
bindkey -e # emacs bindings
bindkey '^[[Z' reverse-menu-complete
@@ -33,7 +41,7 @@ prompt_segment() {
}
prompt_mod_git_info() {
git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/null || return
- prompt_segment "git $(git rev-parse --abbrev-ref HEAD)"
+ prompt_segment "git $(git rev-parse --abbrev-ref HEAD 2> /dev/null)"
}
# only display hostname in prompt if connected over SSH
[ -n "$SSH_CLIENT" ] && PROMPT+="$(prompt_segment '%m')"