Update bash editor configuration

This commit is contained in:
2024-09-29 11:36:20 +02:00
parent 78fafd18ee
commit 6cf696e1f6
3 changed files with 23 additions and 7 deletions

18
.bashrc.d/editor Normal file
View File

@@ -0,0 +1,18 @@
# vim: set ft=bash :
# Set NeoVim as default editor
export EDITOR=nvim
export SUDO_EDITOR="$EDITOR"
declare -A -r EDITOR_CONFIGS=(
["nvim"]="$HOME/.config/nvim/init.lua"
["vim"]="$HOME/.vimrc"
)
edit_editor_config() {
for editor in "${!EDITOR_CONFIGS[@]}"; do
if [ "$EDITOR" = "$editor" ]; then
$EDITOR "${EDITOR_CONFIGS[$editor]}"
fi
done
}