Skip to content

Commit

Permalink
FZF support + improved history
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Apr 11, 2024
1 parent bca8777 commit 0d44c05
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
43 changes: 34 additions & 9 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

################################################################################

Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e

################################################################################

VERSION="2.3.10"
VERSION="2.4.0"

################################################################################

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0d44c05

Please sign in to comment.