From f0d635c121af89c9276506a1e7bc10cdbed5ea58 Mon Sep 17 00:00:00 2001 From: TheK4n Date: Fri, 7 Jan 2022 05:11:54 +0300 Subject: [PATCH] ref .zshrc --- .subzsh/history | 13 +++++++++++++ .subzsh/options | 10 ---------- .subzsh/{export => other} | 17 ++++++++--------- .subzsh/sourcer | 9 +++++---- .zshrc | 6 ++++++ Makefile | 2 +- 6 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 .subzsh/history rename .subzsh/{export => other} (66%) diff --git a/.subzsh/history b/.subzsh/history new file mode 100644 index 0000000..b6996ec --- /dev/null +++ b/.subzsh/history @@ -0,0 +1,13 @@ + +# History configurations +export HISTFILE=~/.zsh_history +export HISTSIZE=1000 +export SAVEHIST=2000 +setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE +setopt hist_ignore_dups # ignore duplicated commands history list +setopt hist_ignore_space # ignore commands that start with space +setopt hist_verify # show command with history expansion to user before running it +#setopt share_history # share command history data + +# configure `time` format +TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P' diff --git a/.subzsh/options b/.subzsh/options index 5a37363..0b4dd80 100644 --- a/.subzsh/options +++ b/.subzsh/options @@ -25,13 +25,3 @@ bindkey '^[[6~' end-of-buffer-or-history # page down bindkey '^[[H' beginning-of-line # home bindkey '^[[F' end-of-line # end bindkey '^[[Z' undo # shift + tab undo last action - -# configure `time` format -TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P' - -# enable auto-suggestions based on the history -if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then - . /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh - # change suggestion color - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#999' -fi diff --git a/.subzsh/export b/.subzsh/other similarity index 66% rename from .subzsh/export rename to .subzsh/other index 952652e..d7144f3 100644 --- a/.subzsh/export +++ b/.subzsh/other @@ -1,13 +1,4 @@ -export HISTFILE=~/.zsh_history -export HISTSIZE=1000 -export SAVEHIST=2000 -setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE -setopt hist_ignore_dups # ignore duplicated commands history list -setopt hist_ignore_space # ignore commands that start with space -setopt hist_verify # show command with history expansion to user before running it -export EDITOR=vim - # enable color support of ls, less and man, and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" @@ -24,3 +15,11 @@ if [ -x /usr/bin/dircolors ]; then zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' fi + + +# enable auto-suggestions based on the history +if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then + . /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh + # change suggestion color + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#999' +fi diff --git a/.subzsh/sourcer b/.subzsh/sourcer index c336a0c..c2b2330 100644 --- a/.subzsh/sourcer +++ b/.subzsh/sourcer @@ -1,13 +1,14 @@ - so () { [ -f "$1" ] && source "$1" } so /etc/zsh_command_not_found -so "$HOME"/.subbash/aliases -so "$HOME"/.subbash/functions -so "$HOME"/.subzsh/export so "$HOME"/.subzsh/options so "$HOME"/.subzsh/completion +so "$HOME"/.subzsh/history so "$HOME"/.subzsh/prompt +so "$HOME"/.subzsh/other + +so "$HOME"/.subbash/aliases +so "$HOME"/.subbash/functions so "$HOME"/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh diff --git a/.zshrc b/.zshrc index 93ab464..28b3f7d 100644 --- a/.zshrc +++ b/.zshrc @@ -1,3 +1,9 @@ + +# .zshrc by TheK4n +# https://github.com/TheK4n/dotfiles + if [ -f $HOME/.subzsh/sourcer ]; then source $HOME/.subzsh/sourcer fi + + diff --git a/Makefile b/Makefile index 09a1df7..6edc559 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,9 @@ backup: install: ln -s $(PWD)/.subbash ~ || true - ln -s $(PWD)/.subzsh ~ || true ln -s $(PWD)/.bashrc ~ || true ln -s $(PWD)/.zshrc ~ || true + ln -s $(PWD)/.zshrc ~ || true ln -s $(PWD)/.tmux.conf ~ || true vim: