Files
nix/dots/.bashrc.d/editor
T
hektor 71725ce35b Add 'dots/' from commit '357b97a7692c8d5ec9666d8d7d7c98d81cb51cf0'
git-subtree-dir: dots
git-subtree-mainline: 2ad98cde17
git-subtree-split: 357b97a769
2025-10-04 18:28:04 +02:00

20 lines
391 B
Bash

# shellcheck shell=bash
# 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
}