From f09d37f5b2f90074c1c862b120b350e8393575ef Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Tue, 7 Nov 2023 13:00:26 +0800 Subject: [PATCH] home,editor: modify configuration --- .../home-manager/resources/editor/helix.nix | 11 +++++------ .../home-manager/resources/editor/vscode.nix | 12 ++++++++++++ users/guanranwang/home-manager/resources/lang/go.nix | 8 ++++---- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/users/guanranwang/home-manager/resources/editor/helix.nix b/users/guanranwang/home-manager/resources/editor/helix.nix index d1608a0..ba8c8ea 100644 --- a/users/guanranwang/home-manager/resources/editor/helix.nix +++ b/users/guanranwang/home-manager/resources/editor/helix.nix @@ -10,13 +10,12 @@ normal = "block"; select = "underline"; }; - statusline = { - mode = { - normal = "--NORMAL--"; - insert = "--INSERT--"; - select = "--SELECT--"; - }; + statusline.mode = { + normal = "--NORMAL--"; + insert = "--INSERT--"; + select = "--SELECT--"; }; + soft-wrap.enable = true; indent-guides.render = true; file-picker.hidden = false; }; diff --git a/users/guanranwang/home-manager/resources/editor/vscode.nix b/users/guanranwang/home-manager/resources/editor/vscode.nix index e1117fa..16dd414 100644 --- a/users/guanranwang/home-manager/resources/editor/vscode.nix +++ b/users/guanranwang/home-manager/resources/editor/vscode.nix @@ -8,6 +8,18 @@ package = pkgs.vscodium; # foss enableExtensionUpdateCheck = false; enableUpdateCheck = false; + keybindings = [ + { + key = "tab"; + command = "selectNextSuggestion"; + when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"; + } + { + "key" = "shift+tab"; + "command" = "selectPrevSuggestion"; + "when" = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"; + } + ]; userSettings = { "diffEditor.ignoreTrimWhitespace" = false; "editor.cursorBlinking" = "smooth"; diff --git a/users/guanranwang/home-manager/resources/lang/go.nix b/users/guanranwang/home-manager/resources/lang/go.nix index 4920247..d5d2da5 100644 --- a/users/guanranwang/home-manager/resources/lang/go.nix +++ b/users/guanranwang/home-manager/resources/lang/go.nix @@ -5,10 +5,10 @@ }: { programs.go.enable = true; - home.packages = with pkgs; [ - ### LSP - gopls - ]; + ### LSP + home.packages = with pkgs; [gopls]; + ### VSCode + programs.vscode.extensions = with pkgs.vscode-extensions; [golang.go]; # Make Go follow XDG # "$HOME/go"...