From 41248eba73f659b0c4a89a51414b6932dfc0a819 Mon Sep 17 00:00:00 2001 From: Redyf Date: Wed, 31 Jan 2024 00:20:07 -0300 Subject: [PATCH 1/3] refactor: Convert copilot config to nix options instead of lua --- config/completion/copilot.nix | 139 +++++++++++++++++----------------- 1 file changed, 68 insertions(+), 71 deletions(-) diff --git a/config/completion/copilot.nix b/config/completion/copilot.nix index 39c5d086..40ab8db2 100644 --- a/config/completion/copilot.nix +++ b/config/completion/copilot.nix @@ -1,79 +1,76 @@ { - plugins.copilot-lua = { - enable = true; - }; - - # keymaps = [ - # { - # mode = "n"; - # key = "t"; - # action = "+copilot"; - # } - # - # { - # mode = "n"; - # key = "to"; - # action = ":Copilot panel"; - # options = { - # silent = true; - # desc = "Open Copilot"; - # }; - # } - # - # { - # mode = "n"; - # key = "tc"; - # action = ":lua require('copilot.suggestion').toggle_auto_trigger()"; - # options = { - # silent = true; - # desc = "Toggle Copilot"; - # }; - # } - # ]; - - extraConfigLua = '' - require('copilot').setup({ + plugins.copilot-lua = + { + enable = true; panel = { - enabled = false, - auto_refresh = true, + enabled = false; + autoRefresh = true; keymap = { - jump_prev = "[[", - jump_next = "]]", - accept = "", - refresh = "gr", - open = "" - }, + jumpPrev = "[["; + jumpNext = "]]"; + accept = ""; + refresh = "gr"; + open = ""; + }; layout = { - position = "bottom", -- | top | left | right - ratio = 0.4 - }, - }, + position = "bottom"; # | top | left | right + ratio = 0.4; + }; + }; suggestion = { - enabled = false, - auto_trigger = true, - debounce = 75, + enabled = false; + autoTrigger = true; + debounce = 75; keymap = { - accept = "", - accept_word = false, - accept_line = false, - next = "", - prev = "", - dismiss = "", - }, - }, + accept = ""; + acceptWord = false; + acceptLine = false; + next = ""; + prev = ""; + dismiss = ""; + }; + }; filetypes = { - yaml = false, - markdown = false, - help = false, - gitcommit = false, - gitrebase = false, - hgcommit = false, - svn = false, - cvs = false, - ["."] = false, - }, - copilot_node_command = 'node', -- Node.js version must be > 18.x - server_opts_overrides = {}, - }) - ''; + yaml = false; + markdown = false; + help = false; + gitcommit = false; + gitrebase = false; + hgcommit = false; + svn = false; + cvs = false; + "." = false; + }; + copilotNodeCommand = "node"; # Node.js version must be > 18.x + serverOptsOverrides = { }; + }; } + +# keymaps = [ +# { +# mode = "n"; +# key = "t"; +# action = "+copilot"; +# } +# +# { +# mode = "n"; +# key = "to"; +# action = ":Copilot panel"; +# options = { +# silent = true; +# desc = "Open Copilot"; +# }; +# } +# +# { +# mode = "n"; +# key = "tc"; +# action = ":lua require('copilot.suggestion').toggle_auto_trigger()"; +# options = { +# silent = true; +# desc = "Toggle Copilot"; +# }; +# } +# ]; + From 4e982e38058400369208e5984bde3c4f3f83949b Mon Sep 17 00:00:00 2001 From: redyf Date: Wed, 31 Jan 2024 03:21:54 +0000 Subject: [PATCH 2/3] Auto lint/format --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 5f7094e9..e04d2a8d 100644 --- a/flake.lock +++ b/flake.lock @@ -139,11 +139,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706487304, - "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "lastModified": 1706589919, + "narHash": "sha256-pNHnDITxSI3a17GOF1RUF3jBO1OiNYTRH2yV/cJG4m4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "rev": "222c1940fafeda4dea161858ffe6ebfc853d3db5", "type": "github" }, "original": { From 6743923cdad204a9efc9a5b8fc879aeb2732b908 Mon Sep 17 00:00:00 2001 From: Redyf Date: Wed, 31 Jan 2024 00:22:36 -0300 Subject: [PATCH 3/3] refactor: clean unnecessary code --- config/completion/copilot.nix | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/config/completion/copilot.nix b/config/completion/copilot.nix index 40ab8db2..ea1c9ac9 100644 --- a/config/completion/copilot.nix +++ b/config/completion/copilot.nix @@ -45,32 +45,3 @@ serverOptsOverrides = { }; }; } - -# keymaps = [ -# { -# mode = "n"; -# key = "t"; -# action = "+copilot"; -# } -# -# { -# mode = "n"; -# key = "to"; -# action = ":Copilot panel"; -# options = { -# silent = true; -# desc = "Open Copilot"; -# }; -# } -# -# { -# mode = "n"; -# key = "tc"; -# action = ":lua require('copilot.suggestion').toggle_auto_trigger()"; -# options = { -# silent = true; -# desc = "Toggle Copilot"; -# }; -# } -# ]; -