Manage VS Code keybindings for GNOME desktops

Deploy user-level keybindings.json from vscode_keybindings so Alt+J
toggles the terminal and the panel from the terminal. Keys avoid
Ctrl+<letter> to leave Vim motions untouched.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Fabio Scotto di Santolo
2026-11-11 19:04:18 +01:00
parent 2cadbf25eb
commit e8db4e5f38
2 changed files with 20 additions and 1 deletions

View File

@@ -144,3 +144,12 @@ vscode_extensions:
- saoudrizwan.claude-dev
- vscodevim.vim
vscode_settings: null
# User-level keybindings apply to every window, including Dev Containers, SSH and WSL remotes.
# Keys avoid Ctrl+<letter>, which the Vim extension uses for its motions; Alt is not bound by Vim.
vscode_keybindings:
- key: alt+j
command: workbench.action.terminal.toggleTerminal
when: "!terminalFocus"
- key: alt+j
command: workbench.action.togglePanel
when: terminalFocus

View File

@@ -47,7 +47,7 @@
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
when: vscode_settings is not none
when: vscode_settings is not none or vscode_keybindings | length > 0
- name: Deploy explicitly managed VS Code settings
ansible.builtin.copy:
@@ -58,3 +58,13 @@
mode: "0644"
backup: true
when: vscode_settings is not none
- name: Deploy managed VS Code keybindings
ansible.builtin.copy:
dest: "{{ user_home }}/.config/Code/User/keybindings.json"
content: "{{ vscode_keybindings | to_nice_json }}\n"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0644"
backup: true
when: vscode_keybindings | length > 0