improve history

main
Yax 2 years ago
parent 29445f479e
commit 8af513b64e

@ -10,25 +10,31 @@ Friend tools:
- vim or neovim, vundle
- python
- perl
- sdkman
- fzf
- mcfly
Configuration file *~/config/chezmoi/chezmoi.toml*
```toml
[data]
# git configuration
git_email = ""
git_alias = ""
projectdir = ""
java6_version = ""
java7_version = ""
java8_version = ""
java11_version = ""
deploydir = ""
java_truststore_file = ""
java_truststore_password = ""
extra_ca_cert = ""
# fzf search path for "p" command
projectdir = "~/work"
# deployment java path for "d" command
deploydir = "~/dist"
# Java versions from sdkman
java6_version = "6.0.119-zulu"
java7_version = "7.0.342-zulu"
java8_version = "8.0.302-open"
java11_version = "11.0.12-open"
# extra certificate for NodeJs (PEM file) to trust HTTPS proxy
extra_ca_cert = "/home/yannic/config/security/ca-node.pem"
# Java truststore for Maven to trust HTTPS proxy
java_truststore_file = "/home/yannic/config/security/snef-security.jks"
java_truststore_password = "secret"
# docker compose bin
docker_compose_command = "/usr/bin/docker compose"
```

@ -14,16 +14,7 @@
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
@ -143,9 +134,28 @@ if [ -d "$HOME/.bashrc.d/" ]; then
done
fi
# replace fzf history (CTRL-R) by https://github.com/cantino/mcfly
if hash mcfly 2>/dev/null; then
eval "$(mcfly init bash)"
fi
# ---------------------------------------------------------------------------
# History
# ---------------------------------------------------------------------------
set -o history
#unset HISTFILE
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# store multiline commands
shopt -s cmdhist
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=2000
HISTFILESIZE=2000
# don't story history commands
HISTIGNORE=history*
# merge history b/w sessions
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"

Loading…
Cancel
Save