dotfiles/home/modules/gui/vscode.nix

240 lines
9.8 KiB
Nix
Raw Normal View History

2024-12-20 01:30:06 +00:00
{ config, pkgs, ... }: {
2024-12-20 01:30:06 +00:00
home.packages = with pkgs; [ hadolint ];
2023-08-18 16:13:15 +00:00
programs.vscode = {
enable = true;
enableExtensionUpdateCheck = false;
enableUpdateCheck = false;
package = pkgs.vscode;
2024-12-20 01:30:06 +00:00
extensions = with pkgs.vscode-extensions;
[
# extensions available as nix packages
bbenoist.nix
github.vscode-github-actions
golang.go
hashicorp.terraform
ms-azuretools.vscode-docker
ms-kubernetes-tools.vscode-kubernetes-tools
ms-vscode-remote.remote-ssh
ms-vscode.powershell
redhat.vscode-yaml
tailscale.vscode-tailscale
tamasfe.even-better-toml
timonwong.shellcheck
vscodevim.vim
yzhang.markdown-all-in-one
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
# extensions from the vscode marketplace
{
name = "auto-align";
publisher = "bladnman";
version = "0.0.13";
sha256 = "sha256-N5XMHW6UadKjE29p2vevtjgqLA4QysYu2xT3njmyHLk=";
}
{
name = "gemini-improved";
publisher = "printfn";
version = "1.0.6";
sha256 = "sha256-PqDBxCT+7wApSwESJRgEes4+sItIF7T3KsIlVaNj2Fg=";
}
{
name = "hadolint";
publisher = "exiasr";
version = "1.1.2";
sha256 = "sha256-6GO1f8SP4CE8yYl87/tm60FdGHqHsJA4c2B6UKVdpgM=";
}
{
name = "hcl";
publisher = "hashicorp";
version = "0.3.2";
sha256 = "sha256-cxF3knYY29PvT3rkRS8SGxMn9vzt56wwBXpk2PqO0mo=";
}
{
name = "jinjahtml";
publisher = "samuelcolvin";
version = "0.20.0";
sha256 = "sha256-wADL3AkLfT2N9io8h6XYgceKyltJCz5ZHZhB14ipqpM=";
}
{
name = "markdown-table-prettify";
publisher = "darkriszty";
version = "3.6.0";
sha256 = "sha256-FZTiNGSY+8xk3DJsTKQu4AHy1UFvg0gbrzPpjqRlECI=";
}
{
name = "snippet";
publisher = "vscode-snippet";
version = "1.2.0";
sha256 = "sha256-eka7JRzSN7VWkLu2kITb5mSYZHpw7Hx8mZboQsFhpms=";
}
];
2024-01-18 03:12:10 +00:00
globalSnippets = {
2024-05-28 18:39:23 +00:00
"Insert datestamp" = {
2024-12-20 01:30:06 +00:00
prefix = [ "date" ];
body = [ ''"''${CURRENT_YEAR}-''${CURRENT_MONTH}-''${CURRENT_DATE}"'' ];
2024-05-28 18:39:23 +00:00
description = "Insert date";
};
2024-01-18 03:12:10 +00:00
"Insert timestamp" = {
2024-12-20 01:30:06 +00:00
prefix = [ "datetime" ];
body = [
''
"''${CURRENT_YEAR}-''${CURRENT_MONTH}-''${CURRENT_DATE}T''${CURRENT_HOUR}:''${CURRENT_MINUTE}:''${CURRENT_SECOND}Z"''
];
2024-01-18 03:12:10 +00:00
description = "Insert date and time";
};
2024-03-22 23:42:03 +00:00
"Torchlight line number markup" = {
2024-12-20 01:30:06 +00:00
prefix = [ "torchlight" ];
body = [ ''torchlight! {"lineNumbers":true}'' ];
2024-03-22 23:42:03 +00:00
description = "Enable Torchlight line numbers";
};
2024-01-18 03:12:10 +00:00
};
2023-07-27 19:03:04 +00:00
keybindings = [
{
key = "backspace";
command = "-markdown.extension.onBackspaceKey";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && vim.mode != 'CommandlineInProgress' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'EasyMotionMode' && vim.mode != 'Normal' && vim.mode != 'Replace' && vim.mode != 'SearchInProgressMode' && vim.mode != 'SurroundInputMode' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "ctrl+shift+alt+down";
command = "-markdown.extension.onCopyLineDown";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "ctrl+shift+alt+up";
command = "-markdown.extension.onCopyLineUp";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "ctrl+enter";
command = "-markdown.extension.onCtrlEnterKey";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "enter";
command = "-markdown.extension.onEnterKey";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && vim.mode != 'CommandlineInProgress' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'EasyMotionMode' && vim.mode != 'Normal' && vim.mode != 'Replace' && vim.mode != 'SearchInProgressMode' && vim.mode != 'SurroundInputMode' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "ctrl+]";
command = "-markdown.extension.onIndentLines";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "alt+down";
command = "-markdown.extension.onMoveLineDown";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "alt+up";
command = "-markdown.extension.onMoveLineUp";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "ctrl+[";
command = "-markdown.extension.onOutdentLines";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "shift+enter";
command = "-markdown.extension.onShiftEnterKey";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "shift+tab";
command = "-markdown.extension.onShiftTabKey";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && markdown.extension.editor.cursor.inList && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
{
key = "tab";
command = "-markdown.extension.onTabKey";
2024-12-20 01:30:06 +00:00
when =
"editorTextFocus && markdown.extension.editor.cursor.inList && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !inlineSuggestionVisible && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
2023-07-27 19:03:04 +00:00
}
];
2024-02-08 19:13:47 +00:00
languageSnippets = {
jinja-yaml = {
"Insert SLS header" = {
isFileTemplate = true;
2024-12-20 01:30:06 +00:00
prefix = [ "sls" ];
body = [ "# -*- coding: utf-8 -*-" "# vim: ft=yaml" "---" "$0" ];
2024-02-08 19:13:47 +00:00
};
};
2024-02-09 22:03:18 +00:00
jinja-html = {
"Insert jinja header" = {
isFileTemplate = true;
2024-12-20 01:30:06 +00:00
prefix = [ "jinja" ];
body = [ "# -*- coding: utf-8 -*-" "# vim: ft=jinja" "$0" ];
2024-02-09 22:03:18 +00:00
};
};
2024-02-08 19:13:47 +00:00
};
userSettings = {
2024-12-20 01:30:06 +00:00
"autoalign.moveableItems" = [ "=" ":" "+=" "-=" ];
"autoalign.nonMoveableItemsAdditional" = [ "ks=" "ds=" ];
"diffEditor.ignoreTrimWhitespace" = false;
"editor.acceptSuggestionOnCommitCharacter" = false;
"editor.acceptSuggestionOnEnter" = "off";
2023-07-27 19:03:04 +00:00
"editor.detectIndentation" = false;
2024-05-28 14:55:48 +00:00
"editor.fontFamily" = "'Berkeley Mono', 'Droid Sans Mono', 'monospace'";
2024-04-20 21:24:41 +00:00
"editor.fontLigatures" = true;
2023-07-27 19:03:04 +00:00
"editor.inlineSuggest.enabled" = true;
2023-11-07 03:39:55 +00:00
"editor.lineNumbers" = "relative";
"editor.quickSuggestions" = {
"other" = true;
"comments" = false;
"strings" = true;
};
"editor.renderControlCharacters" = true;
2023-07-27 19:03:04 +00:00
"editor.renderWhitespace" = "all";
"editor.snippetSuggestions" = "top";
"editor.tabCompletion" = "off";
"editor.tabSize" = 2;
"explorer.confirmDragAndDrop" = false;
2023-08-18 16:14:11 +00:00
"extensions.autoCheckUpdates" = false;
"files.hotExit" = "onExitAndWindowClose";
2023-07-27 19:03:04 +00:00
"files.trimTrailingWhitespace" = true;
"git.confirmSync" = false;
"git.ignoreLegacyWarning" = true;
2024-08-05 01:49:21 +00:00
"go.toolsManagement.autoUpdate" = true;
2023-08-21 18:38:17 +00:00
"go.toolsManagement.checkForUpdates" = "local";
2023-08-29 17:56:29 +00:00
"html.autoClosingTags" = false;
"powershell.codeFormatting.useCorrectCasing" = true;
2023-08-04 12:57:48 +00:00
"powershell.powerShellAdditionalExePaths" = {
"pwsh" = "${config.home.homeDirectory}/.nix-profile/bin/pwsh";
};
"powershell.promptToUpdatePowerShell" = false;
"security.workspace.trust.untrustedFiles" = "open";
2023-08-18 16:14:11 +00:00
"update.mode" = "none";
2024-12-20 01:30:06 +00:00
"vim.normalModeKeyBindings" = [{
"after" = [ "@q" ];
"before" = [ "Q" ];
}];
"vim.statusBarColorControl" = false;
"vim.useCtrlKeys" = false;
2023-07-27 19:03:04 +00:00
"window.restoreWindows" = "none";
2023-08-18 16:14:11 +00:00
"workbench.startupEditor" = "none";
2024-12-20 01:30:06 +00:00
"yaml.customTags" = [ "!reference sequence" ];
"[markdown]" = {
"editor.defaultFormatter" = "yzhang.markdown-all-in-one";
"editor.quickSuggestions" = {
"other" = true;
"comments" = false;
"strings" = true;
};
};
};
};
}