Add history search and append changes

This commit is contained in:
Bart van der Braak 2024-10-23 16:35:06 +02:00
parent 6ba3228e8e
commit 1fbda2bff2
3 changed files with 22 additions and 1 deletions

View file

@ -2,4 +2,5 @@ alias ll='ls -la'
alias lt='ls --human-readable --size -1 -S --classify'
alias nrebuild='sudo nixos-rebuild --use-remote-sudo switch'
alias code='codium'
alias ssh='ensure_ssh_key; ssh'
alias ssh='ensure_ssh_key; ssh'
alias rgf='rg --files | rg'

View file

@ -20,5 +20,24 @@ function ensure_ssh_key {
fi
}
# Map up/down arrow to search for history entries matching what is currently type in the command line.
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
export HISTSIZE=10000
export HISTFILESIZE=10000
HISTCONTROL=erasedups
HISTTIMEFORMAT='%F %T '
shopt -s histappend
shopt -s cmdhist #Save multi line commands as one history entry
PROMPT_COMMAND='history -a' #Append to history after each command
PROMPT_DIRTRIM=2
PS1='\[\033[0;33m\][\u@\h:\w]\$\[\033[0m\] '
RIPGREP_CONFIG_PATH=~/.ripgreprc
# Disable ctrl+s
stty -ixon

1
tongfang/.ripgreprc Normal file
View file

@ -0,0 +1 @@
--hidden