diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2025-06-21 14:07:01 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2025-06-21 14:07:01 +0400 |
commit | c7ccbd92564bdbc488f93002509ebffc603760dd (patch) | |
tree | 692ed0521a9d8cf6936bb393043ef2f02d2203f8 | |
parent | 2efe62013e4eec1434e2e84a9cb8c3f43432501f (diff) |
refactor(bashrc): improve server compatibility and fallback behavior
-rw-r--r-- | config/bash/bashrc | 16 |
1 files changed, 13 insertions, 3 deletions
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"' |