Update the editor change

This commit is contained in:
David Heinemeier Hansson
2026-05-22 14:24:15 +02:00
parent d13aeacabe
commit 923b450d7f
2 changed files with 14 additions and 3 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ echo "Move default editor selection to ~/.local/state/omarchy/defaults/editor"
editor=$(sed -n 's/^export EDITOR=//p' ~/.config/uwsm/default 2>/dev/null | head -n 1)
if [[ -z $editor || $editor == "omarchy-launch-editor" ]]; then
if [[ -z $editor || $editor == "omarchy-launch-editor" || $editor == "omarchy-launch-editor --inline" || $editor == '"omarchy-launch-editor --inline"' ]]; then
editor="nvim"
fi
@@ -14,9 +14,9 @@ fi
if [[ -f ~/.config/uwsm/default ]]; then
if grep -q '^export EDITOR=' ~/.config/uwsm/default; then
sed -i 's|^export EDITOR=.*|export EDITOR=omarchy-launch-editor|' ~/.config/uwsm/default
sed -i 's|^export EDITOR=.*|export EDITOR="omarchy-launch-editor --inline"|' ~/.config/uwsm/default
else
printf '\n# Used by terminal programs to open files with the selected Omarchy default editor\nexport EDITOR=omarchy-launch-editor\n' >>~/.config/uwsm/default
printf '\n# Used by terminal programs to open files with the selected Omarchy default editor\nexport EDITOR="omarchy-launch-editor --inline"\n' >>~/.config/uwsm/default
fi
else
omarchy-refresh-config uwsm/default
+11
View File
@@ -0,0 +1,11 @@
echo "Use inline Omarchy editor launcher for terminal EDITOR"
if [[ -f ~/.config/uwsm/default ]]; then
if grep -q '^export EDITOR=omarchy-launch-editor$' ~/.config/uwsm/default; then
sed -i 's|^export EDITOR=omarchy-launch-editor$|export EDITOR="omarchy-launch-editor --inline"|' ~/.config/uwsm/default
elif ! grep -q '^export EDITOR=' ~/.config/uwsm/default; then
printf '\n# Used by terminal programs to open files with the selected Omarchy default editor\nexport EDITOR="omarchy-launch-editor --inline"\n' >>~/.config/uwsm/default
fi
else
omarchy-refresh-config uwsm/default
fi