From 0d44c059a74a02d6431919841f785e8707b8b76b Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 11 Apr 2024 14:18:35 +0300 Subject: [PATCH] FZF support + improved history --- .zshrc | 43 ++++++++++++++++++++++++++++++++++--------- install.sh | 4 ++-- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.zshrc b/.zshrc index a469e2f..7c511f9 100644 --- a/.zshrc +++ b/.zshrc @@ -10,25 +10,45 @@ export ZSH=$HOME/.oh-my-zsh # GPG always wants to know what TTY it's running on export GPG_TTY=$(tty) -# Default theme +# Set default theme to KAOS ZSH_THEME="kaos" -# History format -HIST_STAMPS="%Y/%m/%d %T" +# Enable git plugin +plugins=(git) -# Enable git and history plugins -plugins=(git history) +# Enable fzf plugin if fzf is installed +if [[ -d "$HOME/.fzf" ]] ; then + export PATH="$HOME/.fzf:$PATH" + plugins+=(fzf) +fi # Disable automatic oh-my-zsh update zstyle ':omz:update' mode disabled -source $ZSH/oh-my-zsh.sh +################################################################################ + +HISTFILE="$HOME/.zsh_history" +HISTSIZE=10000000 +SAVEHIST=10000000 +HISTORY_IGNORE="(ls|ll|cd|pwd|exit|export)*" + +setopt APPEND_HISTORY # Append to history file (Default) +setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format +setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits +setopt SHARE_HISTORY # Share history between all sessions +setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again +setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate +setopt HIST_IGNORE_SPACE # Do not record an event starting with a space +setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file +setopt HIST_VERIFY # Do not execute immediately upon history expansion +setopt HIST_NO_STORE # Don't store history commands +setopt HIST_REDUCE_BLANKS # Remove superfluous blanks from each command line being added to the history ################################################################################ -setopt nocaseglob # ignore case -setopt correct # correct spelling mistakes -setopt auto_cd # if there is no app with given name, try to cd to it +setopt nocaseglob # ignore case +setopt correct # correct spelling mistakes +setopt auto_cd # if there is no app with given name, try to cd to it ################################################################################ @@ -451,3 +471,8 @@ zle -N accept-line reset-prompt-and-accept-line if [[ -f $HOME/.zshrc.local ]] ; then source $HOME/.zshrc.local fi + +################################################################################ + +# Enable oh-my-zsh +source $ZSH/oh-my-zsh.sh diff --git a/install.sh b/install.sh index 32bb469..f0979c9 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,7 @@ set -e ################################################################################ -VERSION="2.3.10" +VERSION="2.4.0" ################################################################################ @@ -91,7 +91,7 @@ banner() { show " ░░░██║░░██║██║░░██║░░░██║░░░██╔══╝░░██║██║░░░░░██╔══╝░░░╚═══██╗" $GREY show " ██╗██████╔╝╚█████╔╝░░░██║░░░██║░░░░░██║███████╗███████╗██████╔╝" $GREY show " ╚═╝╚═════╝░░╚════╝░░░░╚═╝░░░╚═╝░░░░░╚═╝╚══════╝╚══════╝╚═════╝░" $GREY - show " by @andyone | version: $VERSION" $DARK + show " by @andyone | version: $VERSION" $DARK show "" sleep 3