Compare commits

...

2 Commits

Author SHA1 Message Date
Ensar Sarajčić f85fea99a0 Fix nvimremote for sway desktop 2022-10-23 09:50:58 +02:00
Ensar Sarajčić 091e323694 Make nvimremote script more generic 2022-10-23 09:20:28 +02:00
3 changed files with 15 additions and 8 deletions

View File

@ -2,15 +2,22 @@
set -e
SERVER_NAME=$1
FILE=$2
LINE=$3
COLUMN=$4
WINDOW_NAME=$1
SERVER_NAME=$2
FILE=$3
LINE=$4
COLUMN=$5
if test -S $SERVER_NAME; then
/usr/bin/wmctrl -a "Neovim Godot"
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
/usr/bin/wmctrl -a "$WINDOW_NAME"
else
if [ "$XDG_SESSION_DESKTOP" = "sway" ]; then
swaymsg "[title=\"$WINDOW_NAME\"] focus"
fi
fi
~/.asdf/shims/nvim --server $SERVER_NAME --remote $2
~/.asdf/shims/nvim --server $SERVER_NAME --remote-send ":call cursor($LINE, $COLUMN)<CR>"
else
/usr/bin/alacritty --title "Neovim Godot" -e /usr/bin/fish -c "nvim --listen $SERVER_NAME $2 --cmd \"call cursor($LINE, $COLUMN)\""
/usr/bin/alacritty --title "$WINDOW_NAME" -e /usr/bin/fish -c "nvim --listen $SERVER_NAME $2 --cmd \"call cursor($LINE, $COLUMN)\""
fi

View File

@ -96,7 +96,7 @@ text_editor/script_list/current_script_background_color = Color( 1, 1, 1, 0.3 )
text_editor/script_list/group_help_pages = true
text_editor/script_list/sort_scripts_by = 0
text_editor/script_list/list_script_names_as = 0
text_editor/external/exec_flags = "/tmp/godotnvim.sock {file} {line} {col}"
text_editor/external/exec_flags = "NeovimGodot /tmp/godotnvim.sock {file} {line} {col}"
editors/grid_map/preview_size = 64
editors/tile_map/preview_size = 64
editors/tile_map/palette_min_width = 80

View File

@ -38,7 +38,7 @@ text_editor/theme/highlighting/search_result_color = Color(1, 1, 1, 0.07)
text_editor/completion/add_type_hints = true
text_editor/external/use_external_editor = true
text_editor/external/exec_path = "/home/ensar/bin/nvimremote"
text_editor/external/exec_flags = "/tmp/godotnvim.sock {file} {line} {col}"
text_editor/external/exec_flags = "NeovimGodot /tmp/godotnvim.sock {file} {line} {col}"
asset_library/available_urls = {
"godotengine.org (Official)": "https://godotengine.org/asset-library/api"
}