From 696fb6ad7f018d405d192c3c0bbe43668a08833c Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 24 Apr 2020 20:04:35 -0500 Subject: [PATCH] - Added VS Code wordwise fix for xkeysnail --- xkeysnail-config/kinto.py | 18 ++++++++++++++++++ xkeysnail-config/vscode_keybindings.json | 21 +++++++++++++++++++++ xkeysnail_service.sh | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 xkeysnail-config/vscode_keybindings.json diff --git a/xkeysnail-config/kinto.py b/xkeysnail-config/kinto.py index 64c1fa8..0bd720d 100644 --- a/xkeysnail-config/kinto.py +++ b/xkeysnail-config/kinto.py @@ -51,6 +51,24 @@ define_conditional_modmap(re.compile("Gnome-terminal|konsole|io.elementary.termi # Key.RIGHT_CTRL: Key.LEFT_CTRL, # Mac }) +# Keybindings for VS Code +define_keymap(re.compile("Code"),{ + K("C-g"): pass_through_key, # cancel Go to Line... + K("Super-g"): K("C-g"), # Go to Line... + K("F3"): pass_through_key, # cancel Find next + K("C-h"): pass_through_key, # cancel replace + K("C-M-f"): K("C-h"), # replace + K("C-Shift-h"): pass_through_key, # cancel replace_next + K("C-M-e"): K("C-Shift-h"), # replace_next + K("f3"): pass_through_key, # cancel find_next + K("C-g"): K("f3"), # find_next + K("Shift-f3"): pass_through_key, # cancel find_prev + K("C-Shift-g"): K("Shift-f3"), # find_prev + K("Super-C-g"): K("C-f2"), # Sublime - find_all_under + K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up + K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down +}, "Code") + # Keybindings for Sublime Text define_keymap(re.compile("Sublime_text"),{ K("C-Super-up"): K("M-o"), # Switch file diff --git a/xkeysnail-config/vscode_keybindings.json b/xkeysnail-config/vscode_keybindings.json new file mode 100644 index 0000000..30d4657 --- /dev/null +++ b/xkeysnail-config/vscode_keybindings.json @@ -0,0 +1,21 @@ +// Place your key bindings in this file to override the defaultsauto[] +[ + { + "key": "alt+left", + "command": "-workbench.action.terminal.focusPreviousPane", + "when": "terminalFocus" + }, + { + "key": "alt+right", + "command": "-workbench.action.terminal.focusNextPane", + "when": "terminalFocus" + }, + { + "key": "alt+right", + "command": "cursorWordRight" + }, + { + "key": "alt+left", + "command": "cursorWordLeft" + } +] \ No newline at end of file diff --git a/xkeysnail_service.sh b/xkeysnail_service.sh index 1b36fcb..239789d 100755 --- a/xkeysnail_service.sh +++ b/xkeysnail_service.sh @@ -62,7 +62,7 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 sudo pip3 install --upgrade . sudo systemctl enable xkeysnail sudo systemctl daemon-reload - sudo systemctl start xkeysnail + sudo systemctl restart xkeysnail echo "Adding xhost fix..."