ZSH improvements:

- Move from FZF to skim (seems to be a bit faster and smooth)
- Improve history
    * Add new options to not save duplicate entries etc
    * pi/pr aliases expand the paru command to history now
This commit is contained in:
Marko Korhonen 2021-08-17 19:17:38 +03:00
parent 9d3972a54a
commit 270a580e8e
3 changed files with 40 additions and 31 deletions

View file

@ -1,14 +1,23 @@
# zsh key timeout
# key timeout
export KEYTIMEOUT=1
# prompt customization
export PURE_PROMPT_SYMBOL="λ"
export PURE_PROMPT_VICMD_SYMBOL="y"
# zsh history settings
# history settings
export HISTFILE=~/.zsh_history
export HISTSIZE=1000
export SAVEHIST=1000
export HISTSIZE=10000
export SAVEHIST=10000
# Ignore these functions from history since they will
# append the expandend command to the history
export HISTORY_IGNORE="(pi|pr)"
# Additional settings (source https://jdhao.github.io/2021/03/24/zsh_history_setup)
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_SAVE_NO_DUPS
setopt HIST_REDUCE_BLANKS
setopt INC_APPEND_HISTORY_TIME
setopt EXTENDED_HISTORY
# Variable to pass to sdotdrop to get current user
export USRNAME=$USER
@ -16,16 +25,21 @@ export USRNAME=$USER
# go path
export GOPATH=~/.bin/go
# fzf settings
export FZF_DEFAULT_COMMAND='fd -Ht f'
export FZF_ALT_C_COMMAND='fd -Ht d'
export FZF_DEFAULT_OPTS='-m --bind ctrl-a:select-all,ctrl-d:deselect-all,ctrl-t:toggle-all'
export FZF_COMPLETION_TRIGGER='**'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
# use lesspipe with less
export LESSOPEN="|lesspipe.sh %s"
# skim settings
export SKIM_DEFAULT_COMMAND='fd -Ht f'
export SKIM_ALT_C_COMMAND='fd -Ht d'
export SKIM_DEFAULT_OPTS='-m --ansi --bind ctrl-a:toggle-all,ctrl-d:deselect-all,ctrl-t:toggle-all'
export SKIM_DEFAULT_OPTIONS="$SKIM_DEFAULT_OPTS" # TODO make an issue/PR about this difference
export SKIM_COMPLETION_TRIGGER='**'
export SKIM_CTRL_T_COMMAND="$SKIM_DEFAULT_COMMAND"
export SKIM_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
# copy for fzf, incase I ever use it
export FZF_DEFAULT_COMMAND="$SKIM_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="$SKIM_ALT_C_COMMAND"
export FZF_DEFAULT_OPTS="$SKIM_DEFAULT_OPTS"
export FZF_COMPLETION_TRIGGER="$SKIM_COMPLETION_TRIGGER"
export FZF_CTRL_T_COMMAND="$SKIM_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS="$SKIM_CTRL_T_OPTS"
# dotfile repository location
export DOTREPO="$HOME/git/dotfiles"