From a783eb1c867ac3b786813fabdcdc74a5bcbde321 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Mon, 12 Oct 2020 22:10:13 +0200 Subject: [PATCH] Add VSCode configuration and keybinds Signed-off-by: Matej Focko --- playbooks/roles/vscode/tasks/main.yml | 9 ++++ .../vscode/templates/keybindings.json.j2 | 34 ++++++++++++++ .../roles/vscode/templates/settings.json.j2 | 46 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 playbooks/roles/vscode/templates/keybindings.json.j2 create mode 100644 playbooks/roles/vscode/templates/settings.json.j2 diff --git a/playbooks/roles/vscode/tasks/main.yml b/playbooks/roles/vscode/tasks/main.yml index ae3a1bd..9f20eeb 100644 --- a/playbooks/roles/vscode/tasks/main.yml +++ b/playbooks/roles/vscode/tasks/main.yml @@ -3,6 +3,7 @@ block: - shell: mkdir -p ~/.local/bin - shell: mkdir -p ~/.local/share + - shell: mkdir -p ~/.config/Code\ -\ Insiders/User - name: Install VSCode script template: @@ -18,3 +19,11 @@ template: src: templates/code-url.desktop.j2 dest: ~/.local/share/visual-studio-code-insiders-url-handler.desktop + +- name: Install VSCode configuration + template: + src: templates/{{ item }}.json.j2 + dest: ~/.config/Code\ -\ Insiders/User/{{ item }}.json + loop: + - settings + - keybindings diff --git a/playbooks/roles/vscode/templates/keybindings.json.j2 b/playbooks/roles/vscode/templates/keybindings.json.j2 new file mode 100644 index 0000000..b56fe6b --- /dev/null +++ b/playbooks/roles/vscode/templates/keybindings.json.j2 @@ -0,0 +1,34 @@ +[ + { + "key": "alt+f", + "command": "workbench.action.toggleMaximizedPanel" + }, + { + "key": "f7", + "command": "workbench.view.explorer" + }, + { + "key": "f7", + "command": "workbench.action.toggleSidebarVisibility", + "when": "explorerViewletVisible" + }, + { + "key": "ctrl+shift+e", + "command": "-workbench.view.explorer" + }, + { + "key": "ctrl+shift+k", + "command": "workbench.action.terminal.clear", + "when": "terminalFocus" + }, + { + "key": "ctrl+pagedown", + "command": "workbench.action.terminal.focusNext", + "when": "terminalFocus" + }, + { + "key": "ctrl+pageup", + "command": "workbench.action.terminal.focusPrevious", + "when": "terminalFocus" + } +] \ No newline at end of file diff --git a/playbooks/roles/vscode/templates/settings.json.j2 b/playbooks/roles/vscode/templates/settings.json.j2 new file mode 100644 index 0000000..e7234ef --- /dev/null +++ b/playbooks/roles/vscode/templates/settings.json.j2 @@ -0,0 +1,46 @@ +{ + "breadcrumbs.enabled": false, + + "editor.cursorBlinking": "phase", + "editor.cursorStyle": "underline", + + "editor.fontFamily": "CaskaydiaCovePL Nerd Font", + "editor.fontWeight": 350, + "editor.fontSize": 16, + "editor.fontLigatures": true, + + "terminal.integrated.fontSize": 15, + + "editor.highlightActiveIndentGuide": true, + "editor.lineNumbers": "relative", + + "editor.minimap.enabled": false, + "editor.minimap.maxColumn": 80, + + "editor.renderIndentGuides": true, + "editor.renderWhitespace": "all", + "editor.rulers": [ + 80 + ], + + "git.autofetch": true, + + "window.menuBarVisibility": "toggle", + "window.titleBarStyle": "custom", + "window.zoomLevel": 0, + + "workbench.activityBar.visible": true, + "workbench.colorTheme": "Default Dark+", + + "workbench.settings.editor": "json", + "workbench.editor.showTabs": true, + + //****************************** EXTENSIONS ******************************// + + "gitlens.views.compare.location": "scm", + "gitlens.views.fileHistory.location": "scm", + "gitlens.views.lineHistory.location": "scm", + "gitlens.views.repositories.location": "scm", + "gitlens.views.search.location": "scm", + "diffEditor.renderSideBySide": true +} \ No newline at end of file -- 2.45.2