From 10151c17a85fb1808de3cdec4c1447b8d5ed8354 Mon Sep 17 00:00:00 2001 From: jasmine Date: Wed, 19 Feb 2025 23:44:44 +0800 Subject: [PATCH 1/3] chore: update telescope keymap descriptions and file picker key - Change file picker key from "ff" to "sf". - Update description in telescope config for better clarity. - No functional change, just a documentation improvement. --- config/plugins/utils/telescope.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/plugins/utils/telescope.nix b/config/plugins/utils/telescope.nix index 9e01993..8adffe1 100644 --- a/config/plugins/utils/telescope.nix +++ b/config/plugins/utils/telescope.nix @@ -18,10 +18,10 @@ # Configure our telescope keymaps. keymaps = { # File Pickers - "ff" = { + "sf" = { action = "find_files"; options = { - desc = "Find project files"; + desc = "Search project files"; }; }; "/" = { @@ -32,10 +32,10 @@ }; # Vim Pickers - "fb" = { + "sb" = { action = "buffers"; options = { - desc = "Find open buffers"; + desc = "Search open buffers"; }; }; ":" = { From 3d0b34c71406e844eb114a503a8720ee63cf0b8b Mon Sep 17 00:00:00 2001 From: jasmine Date: Wed, 19 Feb 2025 23:45:51 +0800 Subject: [PATCH 2/3] feat: remove unused keymap and simplify whichkey configuration --- config/plugins/utils/whichkey.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/config/plugins/utils/whichkey.nix b/config/plugins/utils/whichkey.nix index cfeac59..7501f1e 100644 --- a/config/plugins/utils/whichkey.nix +++ b/config/plugins/utils/whichkey.nix @@ -5,15 +5,6 @@ # Prefixes, No operation. keymaps = [ - { - mode = "n"; - key = "f"; - action = ""; - options = { - desc = "+find/files"; - }; - } - { mode = "n"; key = "s"; From ff3656deb77a9d9687436485daa3222477624677 Mon Sep 17 00:00:00 2001 From: jasmine Date: Wed, 19 Feb 2025 23:47:16 +0800 Subject: [PATCH 3/3] Commit message: - Update `conform.nix` to configure notifyOnError and add keymaps for conform.nvim. - Remove deprecated format_on_save settings. - Add new key mappings for formatting with conform.nvim. --- config/plugins/lsp/conform.nix | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/config/plugins/lsp/conform.nix b/config/plugins/lsp/conform.nix index 1499a40..892ef38 100644 --- a/config/plugins/lsp/conform.nix +++ b/config/plugins/lsp/conform.nix @@ -7,14 +7,6 @@ enable = true; settings = { - # Run the formatter on file save. - format_on_save = { - lspFallback = true; - timeoutMs = 500; - }; - # Receive notificaton when a formatter errors. - notifyOnError = true; - # Map of filetype to formatters. formatters_by_ft = { c = ["clang-format"]; @@ -34,6 +26,25 @@ command = lib.getExe pkgs.stylua; }; }; + + # Receive notificaton when a formatter errors. + notifyOnError = true; }; }; + + # Keymaps for conform.nvim + keymaps = [ + { + mode = ""; + key = "f"; + action.__raw = '' + function() + require('conform').format { async = true, lsp_fallback = true } + end + ''; + options = { + desc = "Format buffer"; + }; + } + ]; }