Skip to content

Commit

Permalink
Improve bash configuration with blesh
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbruno committed Jul 26, 2024
1 parent 9983adc commit 38cbf14
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions usr/share/biglinux/bash-config/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,6 @@ if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# Auto completion Configuration
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

# ----- NVM Configuration -----
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Expand All @@ -140,6 +131,21 @@ export NVM_DIR="$HOME/.nvm"
if [ -f /usr/share/fzf/key-bindings.bash ]; then
. /usr/share/fzf/completion.bash
. /usr/share/fzf/key-bindings.bash
# using ripgrep combined with preview
# find-in-file - usage: fif <searchTerm>
fif() {
if [ ! "$#" -gt 0 ]; then echo "Need a string to search for!"; return 1; fi
fzf --preview "highlight -O ansi -l {} 2> /dev/null | rga --ignore-case --pretty --context 10 '$1' {}" < <(rga --files-with-matches --no-messages "$1")
}
else
# Auto completion Configuration
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
fi

# Attach Blesh with oh my posh if available
Expand Down

0 comments on commit 38cbf14

Please sign in to comment.