refactor: clean up .bashrc by removing commented-out zoxide initialization and reorganizing fzf history search function
Some checks failed
Nix Format Check / check-format (push) Failing after 38s

This commit is contained in:
Menno van Leeuwen 2025-03-10 19:56:36 +01:00
parent 82ee7361bd
commit 6cb059ebce
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
2 changed files with 19 additions and 25 deletions

43
.bashrc
View File

@ -109,11 +109,6 @@ if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
fi
# zoxide if available
if command -v zoxide &> /dev/null; then
eval "$(zoxide init bash)"
fi
# Check if we are running from zellij, if not then launch it
launch_zellij_conditionally() {
if [ -z "$ZELLIJ" ]; then
@ -139,27 +134,27 @@ launch_zellij_conditionally() {
# launch_zellij_conditionally
# Source ble.sh if it exists
if [[ -f "${HOME}/.nix-profile/share/blesh/ble.sh" ]]; then
source "${HOME}/.nix-profile/share/blesh/ble.sh"
# if [[ -f "${HOME}/.nix-profile/share/blesh/ble.sh" ]]; then
# source "${HOME}/.nix-profile/share/blesh/ble.sh"
# Custom function for fzf history search
function fzf_history_search() {
local selected
selected=$(history | fzf --tac --height=40% --layout=reverse --border --info=inline \
--query="$READLINE_LINE" \
--color 'fg:#ebdbb2,bg:#282828,hl:#fabd2f,fg+:#ebdbb2,bg+:#3c3836,hl+:#fabd2f' \
--color 'info:#83a598,prompt:#bdae93,spinner:#fabd2f,pointer:#83a598,marker:#fe8019,header:#665c54' \
| sed 's/^ *[0-9]* *//')
if [[ -n "$selected" ]]; then
READLINE_LINE="$selected"
READLINE_POINT=${#selected}
fi
ble-redraw-prompt
}
# # Custom function for fzf history search
# function fzf_history_search() {
# local selected
# selected=$(history | fzf --tac --height=40% --layout=reverse --border --info=inline \
# --query="$READLINE_LINE" \
# --color 'fg:#ebdbb2,bg:#282828,hl:#fabd2f,fg+:#ebdbb2,bg+:#3c3836,hl+:#fabd2f' \
# --color 'info:#83a598,prompt:#bdae93,spinner:#fabd2f,pointer:#83a598,marker:#fe8019,header:#665c54' \
# | sed 's/^ *[0-9]* *//')
# if [[ -n "$selected" ]]; then
# READLINE_LINE="$selected"
# READLINE_POINT=${#selected}
# fi
# ble-redraw-prompt
# }
# Bind Ctrl+R to our custom function
bind -x '"\C-r": fzf_history_search'
fi
# # Bind Ctrl+R to our custom function
# bind -x '"\C-r": fzf_history_search'
# fi
# Display a welcome message for interactive shells
if [ -t 1 ]; then

View File

@ -49,7 +49,6 @@
# File and directory operations
eza # Modern ls
bat # Modern cat
zoxide # Smarter cd command
broot # Interactive directory navigator
du-dust # Modern du
duf # Modern df