-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Allow custom editor, like we do custom terminal #1697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
|
|
||
| case "$EDITOR" in | ||
| nvim | vim | nano | micro | hx) | ||
| exec setsid uwsm app -- "$TERMINAL" -e "$EDITOR" "$@" | ||
| ;; | ||
| code | codium | subl | gedit | kate | zeditor) | ||
| exec setsid uwsm app -- "$EDITOR" "$@" | ||
| ;; | ||
| *) | ||
| exec setsid uwsm app -- "$TERMINAL" -e nvim "$@" | ||
| ;; | ||
| esac | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Changes require a relaunch of Hyprland to take effect. | ||
|
|
||
| export TERMINAL=alacritty | ||
| export EDITOR=nvim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| # Editor used by CLI | ||
| export EDITOR="nvim" | ||
| export SUDO_EDITOR="$EDITOR" | ||
| export BAT_THEME=ansi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,16 @@ | ||
| echo "Ensure $TERMINAL is set in uwsm env so entire system can rely on it" | ||
| echo "Set \$TERMINAL and \$EDITOR in ~/.config/uwsm/default so entire system can rely on it" | ||
|
|
||
| if ! grep -q "export TERMINAL" ~/.config/uwsm/env; then | ||
| omarchy-refresh-config uwsm/env | ||
| omarchy-state set relaunch-required | ||
| fi | ||
| # Set terminal and editor default in uwsm | ||
| omarchy-refresh-config uwsm/default | ||
| omarchy-refresh-config uwsm/env | ||
| omarchy-state set relaunch-required | ||
|
|
||
| # Ensure scrolltouchpad setting applies to all terminals | ||
| if grep -q "scrolltouchpad 1.5, class:Alacritty" ~/.config/hypr/input.conf; then | ||
| sed -i 's/windowrule = scrolltouchpad 1\.5, class:Alacritty/windowrule = scrolltouchpad 1.5, tag:terminal/' ~/.config/hypr/input.conf | ||
| fi | ||
|
|
||
| # Use default editor for keybinding | ||
| if grep -q "bindd = SUPER, N, Neovim" ~/.config/hypr/bindings.conf; then | ||
| sed -i '/SUPER, N, Neovim, exec/ c\bindd = SUPER, N, Editor, exec, omarchy-launch-editor' ~/.config/hypr/bindings.conf | ||
| fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have my
EDITORset toemacsclient -c, so will be forced into this branch. I wonder if this might be a bit too clever, with trying to differentiate GUI from TUI editors? Or maybe the fallback should just be the second branch in the above; e.g.So anything we don't definitively know to be TUI is assumed to be a GUI editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that idea. But we also have to deal with the case where no $EDITOR is set and make sure it then opens neovim. Can you open a PR for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will do 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #1702