From 763b9e3340299185240ec45b9c9b67602ce994ec Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 19 Jun 2024 07:15:25 +0200 Subject: fix(modules/nvim): Update to the newest nixVim version This includes replacing the deprecated `lua = true` pattern with a raw lua value and using the new name for `nil_ls`: `nil-ls` --- modules/home/conf/nvim/mappings/default.nix | 12 ++++-------- modules/home/conf/nvim/plgs/debugprint/default.nix | 12 ++++-------- modules/home/conf/nvim/plgs/femaco/default.nix | 3 +-- modules/home/conf/nvim/plgs/goto-preview/default.nix | 15 +++++---------- modules/home/conf/nvim/plgs/harpoon/default.nix | 18 ++++++------------ modules/home/conf/nvim/plgs/lsp/keymaps/default.nix | 6 ++---- modules/home/conf/nvim/plgs/lsp/servers/default.nix | 2 +- .../home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix | 10 ++++++++++ .../home/conf/nvim/plgs/lsp/servers/servers/nil_ls.nix | 10 ---------- .../plgs/telescope/extensions/frecency/default.nix | 3 +-- .../nvim/plgs/telescope/extensions/symbols/default.nix | 9 +++------ 11 files changed, 37 insertions(+), 63 deletions(-) create mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix delete mode 100644 modules/home/conf/nvim/plgs/lsp/servers/servers/nil_ls.nix (limited to 'modules/home/conf') diff --git a/modules/home/conf/nvim/mappings/default.nix b/modules/home/conf/nvim/mappings/default.nix index 2cb174a4..af800d22 100644 --- a/modules/home/conf/nvim/mappings/default.nix +++ b/modules/home/conf/nvim/mappings/default.nix @@ -14,7 +14,7 @@ { key = "hh"; mode = ["i"]; - action = '' + action.__raw = '' function() local cmp = require('cmp'); local luasnip = require('luasnip'); @@ -26,19 +26,17 @@ end end ''; - lua = true; options.desc = "completion trigger/ forward in completen menu"; } { key = "uu"; mode = ["i"]; - action = '' + action.__raw = '' function() local cmp = require('cmp'); cmp.confirm() end ''; - lua = true; options.desc = "confirm the selected item"; } @@ -171,8 +169,7 @@ { mode = ["n"]; key = "\\f"; - action = "function() require('lf').start() end"; - lua = true; + action.__raw = "function() require('lf').start() end"; options.desc = "open lf in a floating window"; } @@ -224,7 +221,7 @@ { key = "dd"; mode = ["n"]; - action = '' + action.__raw = '' function() if vim.api.nvim_get_current_line():match("^%s*$") then return '"_dd' @@ -233,7 +230,6 @@ end end ''; - lua = true; options = { desc = "Pipe all blank line deletions to the blackhole register"; expr = true; diff --git a/modules/home/conf/nvim/plgs/debugprint/default.nix b/modules/home/conf/nvim/plgs/debugprint/default.nix index b0d72339..3c591e9f 100644 --- a/modules/home/conf/nvim/plgs/debugprint/default.nix +++ b/modules/home/conf/nvim/plgs/debugprint/default.nix @@ -16,12 +16,11 @@ { key = "g?v"; mode = ["v" "n"]; - action = '' + action.__raw = '' function() return require('debugprint').debugprint({variable = true;}); end ''; - lua = true; options.expr = true; options.desc = '' 'variable' debug line below the current line @@ -30,12 +29,11 @@ { key = "g?V"; mode = ["v" "n"]; - action = '' + action.__raw = '' function() return require('debugprint').debugprint({above = true; variable = true;}) ; end ''; - lua = true; options.expr = true; options.desc = '' 'variable' debug line above the current line @@ -44,12 +42,11 @@ { key = "g?p"; mode = "n"; - action = '' + action.__raw = '' function() return require('debugprint').debugprint(); end ''; - lua = true; options.expr = true; options.desc = '' 'plain' debug line below the current line @@ -58,12 +55,11 @@ { key = "g?P"; mode = "n"; - action = '' + action.__raw = '' function() return require('debugprint').debugprint({above = true;}); end ''; - lua = true; options.expr = true; options.desc = '' 'plain' debug line above the current line diff --git a/modules/home/conf/nvim/plgs/femaco/default.nix b/modules/home/conf/nvim/plgs/femaco/default.nix index 0b4f7937..6c4a7d89 100644 --- a/modules/home/conf/nvim/plgs/femaco/default.nix +++ b/modules/home/conf/nvim/plgs/femaco/default.nix @@ -15,8 +15,7 @@ { key = "cc"; mode = "n"; - action = "require('femaco.edit').edit_code_block"; - lua = true; + action.__raw = "require('femaco.edit').edit_code_block"; options.desc = "edit a [c]ode blo[c]k with femaco"; } ]; diff --git a/modules/home/conf/nvim/plgs/goto-preview/default.nix b/modules/home/conf/nvim/plgs/goto-preview/default.nix index 13a26212..3de28c68 100644 --- a/modules/home/conf/nvim/plgs/goto-preview/default.nix +++ b/modules/home/conf/nvim/plgs/goto-preview/default.nix @@ -15,36 +15,31 @@ { key = "gd"; mode = "n"; - action = "require('goto-preview').goto_preview_definition"; - lua = true; + action.__raw = "require('goto-preview').goto_preview_definition"; options.desc = "[G]oto [D]efinition"; } { key = "gtd"; mode = "n"; - action = "require('goto-preview').goto_preview_type_definition"; - lua = true; + action.__raw = "require('goto-preview').goto_preview_type_definition"; options.desc = "[G]oto the [t]ype [D]efinition"; } { key = "gi"; mode = "n"; - action = "require('goto-preview').goto_preview_implementation"; - lua = true; + action.__raw = "require('goto-preview').goto_preview_implementation"; options.desc = "[G]oto [I]mplementations"; } { key = "gr"; mode = "n"; - action = "require('goto-preview').goto_preview_references"; - lua = true; + action.__raw = "require('goto-preview').goto_preview_references"; options.desc = "[G]o to all [R]eferences of the symbol"; } { key = "\\"; mode = "n"; - action = "require('goto-preview').close_all_win"; - lua = true; + action.__raw = "require('goto-preview').close_all_win"; options.desc = "close all preview windows"; } ]; diff --git a/modules/home/conf/nvim/plgs/harpoon/default.nix b/modules/home/conf/nvim/plgs/harpoon/default.nix index b1421dab..fa275f1b 100644 --- a/modules/home/conf/nvim/plgs/harpoon/default.nix +++ b/modules/home/conf/nvim/plgs/harpoon/default.nix @@ -7,12 +7,11 @@ desc_template, }: { key = "${prefix}${number}"; - action = '' + action.__raw = '' function() ${command_template number} end ''; - lua = true; options.desc = "${desc_template number}"; }; mkGotoTerminalCommand = number: let @@ -45,52 +44,47 @@ in { [ { key = "-"; - action = '' + action.__raw = '' function() require("harpoon.ui").nav_next() end ''; - lua = true; options.desc = "go to the next marked file"; } { key = "_"; - action = '' + action.__raw = '' function() require("harpoon.ui").nav_prev() end ''; - lua = true; options.desc = "go to the previous marked file"; } { key = ""; - action = '' + action.__raw = '' function() require("harpoon.mark").add_file() end ''; - lua = true; options.desc = "add a mark to the open file in harpoon."; } { key = "gqc"; - action = '' + action.__raw = '' function() require("harpoon.cmd-ui").toggle_quick_menu() end ''; - lua = true; options.desc = "toggle the harpoon command quick menu to see all commands."; } { key = "q"; - action = '' + action.__raw = '' function() require("harpoon.ui").toggle_quick_menu() end ''; - lua = true; options.desc = "toggle the harpoon normal quick menu to see all marks."; } ] diff --git a/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix b/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix index e176461e..b1276639 100644 --- a/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix +++ b/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix @@ -53,18 +53,16 @@ keymaps = [ { key = "f"; - action = "function() vim.lsp.buf.format { async = true } end"; - lua = true; + action.__raw = "function() vim.lsp.buf.format { async = true } end"; options.desc = "[F]ormat the current buffer (asynchronously)"; } { key = "wl"; - action = '' + action.__raw = '' function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end ''; - lua = true; options.desc = "[W]orkspace folders [l]ist"; } ]; diff --git a/modules/home/conf/nvim/plgs/lsp/servers/default.nix b/modules/home/conf/nvim/plgs/lsp/servers/default.nix index 1f59ae4e..605046d4 100644 --- a/modules/home/conf/nvim/plgs/lsp/servers/default.nix +++ b/modules/home/conf/nvim/plgs/lsp/servers/default.nix @@ -6,7 +6,7 @@ ./servers/quick-lint-js.nix ./servers/ltex.nix ./servers/lua-ls.nix - ./servers/nil_ls.nix + ./servers/nil-ls.nix ./servers/openscad.nix ./servers/ruff-lsp.nix ./servers/rust-analyzer.nix diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix new file mode 100644 index 00000000..ab9e643b --- /dev/null +++ b/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix @@ -0,0 +1,10 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + nil-ls = { + enable = true; + settings = { + formatting.command = ["alejandra"]; + }; + }; + }; +} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/nil_ls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/nil_ls.nix deleted file mode 100644 index f0cccbdc..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/nil_ls.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - nil_ls = { - enable = true; - settings = { - formatting.command = ["alejandra"]; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/frecency/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/frecency/default.nix index c1cebc09..0e007b80 100644 --- a/modules/home/conf/nvim/plgs/telescope/extensions/frecency/default.nix +++ b/modules/home/conf/nvim/plgs/telescope/extensions/frecency/default.nix @@ -4,8 +4,7 @@ { key = "gff"; mode = "n"; - action = "function() require('telescope').extensions.frecency.frecency() end"; - lua = true; + action.__raw = "function() require('telescope').extensions.frecency.frecency() end"; options.desc = "activate the frecency file selection"; } ]; diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/symbols/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/symbols/default.nix index fa166c02..05b4a4f2 100644 --- a/modules/home/conf/nvim/plgs/telescope/extensions/symbols/default.nix +++ b/modules/home/conf/nvim/plgs/telescope/extensions/symbols/default.nix @@ -8,33 +8,31 @@ { key = "il"; mode = "n"; - action = '' + action.__raw = '' function() require('telescope.builtin').symbols{ sources = { 'latex' }} end ''; - lua = true; options.desc = "[i]nsert a [l]atex symbol"; } { key = "ie"; mode = "n"; - action = '' + action.__raw = '' function() require('telescope.builtin').symbols{ sources = { 'emoji', }} end ''; - lua = true; options.desc = "[i]nsert a [e]moji"; } { key = "is"; mode = "n"; - action = '' + action.__raw = '' function() require('telescope.builtin').symbols{ sources = { 'emoji', @@ -47,7 +45,6 @@ }} end ''; - lua = true; options.desc = "[i]nsert a [s]ymbol (like emojis)"; } ]; -- cgit 1.4.1