From c7ccbd92564bdbc488f93002509ebffc603760dd Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Sat, 21 Jun 2025 14:07:01 +0400 Subject: refactor(bashrc): improve server compatibility and fallback behavior --- config/bash/bashrc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'config/bash/bashrc') diff --git a/config/bash/bashrc b/config/bash/bashrc index 8396d9f..a4b497f 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -1,3 +1,5 @@ +# Minimal bashrc meant for servers + set -o vi # `set show-mode-in-prompt on` is not set, # indicating vi mode in bash is too slow @@ -16,13 +18,21 @@ if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ];then else # Fallback aliases where aliasrc isn't present (e.g., on servers) alias \ - vi="vim" \ + claer="clear -x" \ + clear="clear -x" \ + clera="clear -x" \ + lf="lfcd" \ vi="nvim" \ - clear="clear -x" + vi="vim" fi if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" ];then source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" - bind '"\C-o": "\C-ulfcd\n"' +else + lfcd () { + cd "$(command lf -print-last-dir "$@")" + } fi + +bind '"\C-o": "\C-ulfcd\n"' -- cgit v1.2.3