aboutsummaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2022-03-18 13:58:56 -0400
committertdro <tdro@users.noreply.github.com>2022-03-18 14:05:43 -0400
commitd60564519cb4fab19dbf270dd7696052990fcfe1 (patch)
treee5b71478284050f5ad3715d6561f2dba78f11902 /.bashrc
parentd8f916b6fe986a2974620d4386ec50de08f9d938 (diff)
downloaddotfiles-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--.bashrc33
1 files changed, 15 insertions, 18 deletions
diff --git a/.bashrc b/.bashrc
index 66a7d8c..c765041 100644
--- a/.bashrc
+++ b/.bashrc
@@ -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" \