From a9bae9ddd27f0e1bac42ce87a5e7bce1c0d9a6b1 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 23 Mar 2022 02:37:02 +0100 Subject: [PATCH] Remove now unneeded oh-my-zsh lib, set some options it set --- .config/zsh/.zprofile | 5 +++-- .config/zsh/.zshrc | 12 +++++++++++- .config/zsh/themes/prompt.zsh | 2 +- .config/zsh/zkeys | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 2e43efb..5be8d2b 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -61,10 +61,11 @@ if command -v antibody > /dev/null; then else mkdir -p ${plugin_cache_dir} antibody bundle --parallelism=$(nproc --ignore=1) < ${ZSH_PLUGIN_SOURCE} -robbyrussell/oh-my-zsh path:lib -robbyrussell/oh-my-zsh path:plugins/history-substring-search +# robbyrussell/oh-my-zsh path:lib +# robbyrussell/oh-my-zsh path:plugins/history-substring-search ${depends_on_fzf} zsh-users/zsh-autosuggestions +zsh-users/zsh-history-substring-search mafredri/zsh-async zsh-users/zsh-syntax-highlighting EOF diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 33f237d..39a8ff1 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -5,6 +5,12 @@ function() # Keep local variables in here. autoload -Uz compinit compinit -d "${ZSH_CACHE_DIR}/.zcompdump" +# Directory options +setopt AUTO_CD AUTO_PUSHD PUSHD_IGNORE_DUPS PUSHD_MINUS + +# Various options +setopt CORRECT_ALL FLOW_CONTROL INTERACTIVE_COMMENTS LONG_LIST_JOBS + ############################## Plugins ######################################### # Hyphen-insensitive completion. Case sensitive completion must be off. _ and - @@ -64,6 +70,8 @@ HIST_STAMPS="yyyy-mm-dd" # Write command to history file after it is finished, with time and duration. # setopt NO_SHARE_HISTORY EXTENDED_HISTORY INC_APPEND_HISTORY_TIME setopt EXTENDED_HISTORY SHARE_HISTORY +setopt HIST_EXPIRE_DUPS_FIRST HIST_IGNORE_DUPS HIST_IGNORE_SPACE +setopt HIST_VERIFY # Import new commands from the history file. function precmd_history @@ -74,6 +82,8 @@ function precmd_history ############################## Completion ###################################### +setopt ALWAYS_TO_END COMPLETE_IN_WORD + # Configure completions. zstyle ':completion::complete:*' cache-path "${ZSH_CACHE_DIR}/.zcompcache" zstyle ':completion:*' completer _complete _ignored _approximate @@ -156,7 +166,7 @@ case ${TERM} in fi ;; (dumb) # Emacs shells and TRAMP. - unsetopt zle + unsetopt ZLE if [[ "${INSIDE_EMACS}" =~ "tramp" ]]; then HISTFILE="/dev/null" diff --git a/.config/zsh/themes/prompt.zsh b/.config/zsh/themes/prompt.zsh index 12d573f..ffbd508 100644 --- a/.config/zsh/themes/prompt.zsh +++ b/.config/zsh/themes/prompt.zsh @@ -80,7 +80,7 @@ else add-zsh-hook precmd vcs_info fi -setopt prompt_subst +setopt PROMPT_SUBST PROMPT="%B%F{${zsh_theme_colours[prompt]}}${showuser}%b"'${vcs_info_msg_0_}'"%B%F{${zsh_theme_colours[prompt]}}%#%f%b " RPROMPT="%F{${zsh_theme_colours[minor]}}%(?..[%B%F{${zsh_theme_colours[highlight]}}%?%b%F{${zsh_theme_colours[minor]}}] )%4~%f" diff --git a/.config/zsh/zkeys b/.config/zsh/zkeys index 2eb8a5a..4a6ae00 100644 --- a/.config/zsh/zkeys +++ b/.config/zsh/zkeys @@ -51,6 +51,8 @@ bindkey '^[[1;5B' history-substring-search-down bindkey '^H' backward-delete-word # C-BackSpace bindkey '^[[3;5~' delete-word # C-Del +bindkey '^[[1;5D' backward-word # C-Left +bindkey '^[[1;5C' forward-word # C-Right if [[ "${TERM}" =~ "^rxvt" ]]; then