Update the editor change
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user