mirror of
https://github.com/bertptrs/vimconfig.git
synced 2025-12-25 20:40:32 +01:00
Improve history configuration.
This commit is contained in:
37
zsh/.zshrc
37
zsh/.zshrc
@@ -26,13 +26,6 @@ autoload -U promptinit
|
|||||||
promptinit
|
promptinit
|
||||||
prompt bart
|
prompt bart
|
||||||
|
|
||||||
# No dupes in history
|
|
||||||
setopt HIST_IGNORE_DUPS
|
|
||||||
|
|
||||||
# Shared history between sessions
|
|
||||||
setopt inc_append_history
|
|
||||||
setopt share_history
|
|
||||||
|
|
||||||
# Setup the CNF hook
|
# Setup the CNF hook
|
||||||
if [[ -s /usr/share/doc/pkgfile/command-not-found.zsh ]]; then
|
if [[ -s /usr/share/doc/pkgfile/command-not-found.zsh ]]; then
|
||||||
source /usr/share/doc/pkgfile/command-not-found.zsh
|
source /usr/share/doc/pkgfile/command-not-found.zsh
|
||||||
@@ -82,7 +75,9 @@ bindkey "${terminfo[kend]}" end-of-line
|
|||||||
transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
|
transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
|
||||||
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }; alias transfer=transfer
|
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }; alias transfer=transfer
|
||||||
|
|
||||||
# The following lines were added by compinstall
|
##############################
|
||||||
|
# Autocomplete configuration #
|
||||||
|
##############################
|
||||||
|
|
||||||
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
|
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
|
||||||
zstyle ':completion:*' list-colors ''
|
zstyle ':completion:*' list-colors ''
|
||||||
@@ -96,11 +91,31 @@ zstyle :compinstall filename '/home/bert/.zshrc'
|
|||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
|
|
||||||
|
##########################
|
||||||
|
## History configuration #
|
||||||
|
##########################
|
||||||
|
|
||||||
|
# Shared history between sessions
|
||||||
|
setopt inc_append_history
|
||||||
|
setopt share_history
|
||||||
|
setopt hist_expire_dups_first
|
||||||
|
setopt hist_ignore_space
|
||||||
|
setopt hist_reduce_blanks
|
||||||
|
setopt hist_expire_dups_first
|
||||||
|
setopt extended_history # Record times in history
|
||||||
|
setopt hist_ignore_all_dups
|
||||||
|
|
||||||
|
# Configure alternative histfile location
|
||||||
HISTFILE="$XDG_DATA_HOME/zsh/histfile"
|
HISTFILE="$XDG_DATA_HOME/zsh/histfile"
|
||||||
if [ ! -d $(dirname $HISTFILE) ]
|
if [ ! -d $(dirname $HISTFILE) ]
|
||||||
then
|
then
|
||||||
mkdir -p $(dirname $HISTFILE)
|
mkdir -p $(dirname $HISTFILE)
|
||||||
fi
|
fi
|
||||||
HISTSIZE=1000
|
|
||||||
SAVEHIST=1000
|
# Increase history size
|
||||||
setopt autocd notify
|
HISTSIZE=10000
|
||||||
|
SAVEHIST=$HISTSIZE
|
||||||
|
|
||||||
|
setopt autocd # Automatically cd to dirs typed
|
||||||
|
setopt notify
|
||||||
|
|||||||
Reference in New Issue
Block a user