diff options
author | tdro <tdro@users.noreply.github.com> | 2022-03-18 13:58:56 -0400 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2022-03-18 14:05:43 -0400 |
commit | d60564519cb4fab19dbf270dd7696052990fcfe1 (patch) | |
tree | e5b71478284050f5ad3715d6561f2dba78f11902 /.bashrc | |
parent | d8f916b6fe986a2974620d4386ec50de08f9d938 (diff) | |
download | dotfiles-d60564519cb4fab19dbf270dd7696052990fcfe1.tar.gz dotfiles-d60564519cb4fab19dbf270dd7696052990fcfe1.tar.bz2 dotfiles-d60564519cb4fab19dbf270dd7696052990fcfe1.zip |
.bash_profile: Fix history with real persist
Use custom fzf completion and bindings.
Diffstat (limited to '.bashrc')
-rw-r--r-- | .bashrc | 33 |
1 files changed, 15 insertions, 18 deletions
@@ -1,37 +1,37 @@ #!/bin/bash -eu # source exports -export BASH_PROFILE=1 && . "$HOME/.bash_profile"; +export BASH_PROFILE=1 && . "$HOME/.bash_profile" # bail if not interactive -printf '%s' "$-" | grep -q "i" || return; +printf '%s' "$-" | grep -q "i" || return # cd using directory name -shopt -s autocd; +shopt -s autocd # append bash history entries -shopt -s histappend; +shopt -s histappend # bash history one command per line -shopt -s cmdhist; +shopt -s cmdhist # disable program completion -shopt -u progcomp; +shopt -u progcomp # enable vi mode -set -o vi; +set -o vi # disable ctrl+s -stty stop ''; -stty start ''; -stty -ixon; -stty -ixoff; +stty stop '' +stty start '' +stty -ixon +stty -ixoff # fzf bindings -fzfcompletion=$(readlink "$(type -P fzf)" | cut -d '/' -f -4)/share/fzf/completion.bash; -fzfkeybindings=$(readlink "$(type -P fzf)" | cut -d '/' -f -4)/share/fzf/key-bindings.bash; -[ -f "$fzfcompletion" ] && . "$fzfcompletion"; -[ -f "$fzfkeybindings" ] && . "$fzfkeybindings"; +fzfcompletion="$HOME/.config/fzf/completion.bash" +fzfkeybindings="$HOME/.config/fzf/key-bindings.bash" +[ -f "$fzfcompletion" ] && . "$fzfcompletion" +[ -f "$fzfkeybindings" ] && . "$fzfkeybindings" # set virtual console colors if [ "$TERM" = "linux" ]; then @@ -119,9 +119,6 @@ lxc-destroy() { for container in "$@"; do $(type -P lxc-destroy) --name "$contai # source fzf markers [ -f "$HOME/.config/fzf/marks.plugin.bash" ] && . "$HOME/.config/fzf/marks.plugin.bash" -# remove bash history duplicates -history-remove-duplicates() { awk '!visited[$0]++' "$HOME/.bash_history" | sponge "$HOME/.bash_history"; } - # extract docker container as rootfs docker-rootfs() { id=$(docker run --detach "$1" /bin/true) \ && docker export "$id" --output "rootfs.tar" \ |