diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index 8dcfc5b0..28e7c79c 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -81,16 +81,6 @@ favor of nixfmt (more information can be found To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to `nixfmt`. -### leader changes {#sec-leader-changes} - -This has been deprecated in favor of using the more generic `vim.globals` (you -can use `vim.globals.mapleader` to change this instead). - -Rust specific keymaps now use `maplocalleader` instead of `localleader` by -default. This is to avoid conflicts with other modules. You can change -`maplocalleader` with `vim.globals.maplocalleader`, but it's recommended to set -it to something other than `mapleader` to avoid conflicts. - ## Changelog {#sec-release-0.7-changelog} [ItsSorae](https://github.com/ItsSorae): @@ -211,9 +201,6 @@ it to something other than `mapleader` to avoid conflicts. is bundled with nvf, if you enable the module, since there is no way to provide only the LSP server. -- Add [`run.nvim`](https://github.com/diniamo/run.nvim) support for running code - using cached commands. - [Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd() - Make Neovim's configuration file entirely Lua based. This comes with a few diff --git a/flake.lock b/flake.lock index 1721d8a6..5e201d89 100644 --- a/flake.lock +++ b/flake.lock @@ -1710,22 +1710,6 @@ "type": "github" } }, - "plugin-run-nvim": { - "flake": false, - "locked": { - "lastModified": 1732918526, - "narHash": "sha256-kiszNmZZDXG8tAPMQKuGJDCkqCMzsWT7BkCvkVsH2lA=", - "owner": "diniamo", - "repo": "run.nvim", - "rev": "d867466e01b8fa4e54a589b9ef446cf43fb966de", - "type": "github" - }, - "original": { - "owner": "diniamo", - "repo": "run.nvim", - "type": "github" - } - }, "plugin-rustaceanvim": { "flake": false, "locked": { @@ -2139,7 +2123,6 @@ "plugin-registers": "plugin-registers", "plugin-rose-pine": "plugin-rose-pine", "plugin-rtp-nvim": "plugin-rtp-nvim", - "plugin-run-nvim": "plugin-run-nvim", "plugin-rustaceanvim": "plugin-rustaceanvim", "plugin-smartcolumn": "plugin-smartcolumn", "plugin-sqls-nvim": "plugin-sqls-nvim", diff --git a/flake.nix b/flake.nix index e52f9416..1123432e 100644 --- a/flake.nix +++ b/flake.nix @@ -238,12 +238,6 @@ flake = false; }; - # Runners - plugin-run-nvim = { - url = "github:diniamo/run.nvim"; - flake = false; - }; - # Debuggers plugin-nvim-dap = { url = "github:mfussenegger/nvim-dap"; diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 45dba827..a4ac56a3 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -59,10 +59,5 @@ in { With Trouble having so many different modes, and breaking changes upstream, it no longer makes sense, nor works, to toggle only Trouble. '') - # 2024-11-30 - (mkRemovedOptionModule ["vim" "leaderKey"] '' - This has been deprecated in favor of using the more generic `vim.globals` - (you can use `vim.globals.mapleader` to change this instead). - '') ]; } diff --git a/modules/modules.nix b/modules/modules.nix index bc441e96..784c413e 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -31,7 +31,6 @@ "notes" "projects" "rich-presence" - "runner" "session" "snippets" # "spellcheck" # FIXME: see neovim/init/spellcheck.nix diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index c7d98e02..2114dcb8 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -14,6 +14,12 @@ cfg = config.vim; in { options.vim = { + leaderKey = mkOption { + type = str; + default = " "; + description = "The leader key used for `` mappings"; + }; + colourTerm = mkOption { type = bool; default = true; @@ -191,6 +197,8 @@ in { vim.o.tm = ${toLuaObject cfg.mapTimeout} vim.o.cursorlineopt = ${toLuaObject cfg.cursorlineOpt} vim.o.scrolloff = ${toLuaObject cfg.scrollOffset} + vim.g.mapleader = ${toLuaObject cfg.leaderKey} + vim.g.maplocalleader = ${toLuaObject cfg.leaderKey} ${optionalString cfg.undoFile.enable '' vim.o.undofile = true diff --git a/modules/plugins/languages/rust.nix b/modules/plugins/languages/rust.nix index ec1887cb..f0262997 100644 --- a/modules/plugins/languages/rust.nix +++ b/modules/plugins/languages/rust.nix @@ -145,13 +145,13 @@ in { on_attach = function(client, bufnr) default_on_attach(client, bufnr) local opts = { noremap=true, silent=true, buffer = bufnr } - vim.keymap.set("n", "rr", ":RustLsp runnables", opts) - vim.keymap.set("n", "rp", ":RustLsp parentModule", opts) - vim.keymap.set("n", "rm", ":RustLsp expandMacro", opts) - vim.keymap.set("n", "rc", ":RustLsp openCargo", opts) - vim.keymap.set("n", "rg", ":RustLsp crateGraph x11", opts) + vim.keymap.set("n", "rr", ":RustLsp runnables", opts) + vim.keymap.set("n", "rp", ":RustLsp parentModule", opts) + vim.keymap.set("n", "rm", ":RustLsp expandMacro", opts) + vim.keymap.set("n", "rc", ":RustLsp openCargo", opts) + vim.keymap.set("n", "rg", ":RustLsp crateGraph x11", opts) ${optionalString cfg.dap.enable '' - vim.keymap.set("n", "rd", ":RustLsp debuggables", opts) + vim.keymap.set("n", "rd", ":RustLsp debuggables", opts) vim.keymap.set( "n", "${config.vim.debugger.nvim-dap.mappings.continue}", function() diff --git a/modules/plugins/runner/default.nix b/modules/plugins/runner/default.nix deleted file mode 100644 index d37fb5f4..00000000 --- a/modules/plugins/runner/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./run-nvim - ]; -} diff --git a/modules/plugins/runner/run-nvim/config.nix b/modules/plugins/runner/run-nvim/config.nix deleted file mode 100644 index 70cd5c9f..00000000 --- a/modules/plugins/runner/run-nvim/config.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - lib, - config, - options, - ... -}: let - inherit (lib.modules) mkIf mkDefault; - inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLznBinding mkSetLuaLznBinding; - - cfg = config.vim.runner.run-nvim; - mappingDefinitions = options.vim.runner.run-nvim.mappings; - mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; -in { - config = mkIf cfg.enable { - vim = { - lazy.plugins.run-nvim = { - package = "run-nvim"; - setupModule = "run"; - inherit (cfg) setupOpts; - - cmd = "Run"; - - keys = [ - (mkSetLznBinding "n" mappings.run "Run") - (mkSetLznBinding "n" mappings.runOverride "Run!") - (mkSetLuaLznBinding "n" mappings.runCommand '' - function() - local input = vim.fn.input("Run command: ") - if input ~= "" then require("run").run(input, false) end - end - '') - ]; - }; - - binds.whichKey.register."r" = mkDefault "+Run"; - }; - }; -} diff --git a/modules/plugins/runner/run-nvim/default.nix b/modules/plugins/runner/run-nvim/default.nix deleted file mode 100644 index 5062c6e7..00000000 --- a/modules/plugins/runner/run-nvim/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./run-nvim.nix - ./config.nix - ]; -} diff --git a/modules/plugins/runner/run-nvim/run-nvim.nix b/modules/plugins/runner/run-nvim/run-nvim.nix deleted file mode 100644 index dd24e6c3..00000000 --- a/modules/plugins/runner/run-nvim/run-nvim.nix +++ /dev/null @@ -1,18 +0,0 @@ -{lib, ...}: let - inherit (lib.options) mkEnableOption; - inherit (lib.nvim.types) mkPluginSetupOption; - inherit (lib.nvim.binds) mkMappingOption; -in { - options = { - vim.runner.run-nvim = { - enable = mkEnableOption "run.nvim"; - setupOpts = mkPluginSetupOption "run.nvim" {}; - - mappings = { - run = mkMappingOption "Run cached" "ri"; - runOverride = mkMappingOption "Run and override" "ro"; - runCommand = mkMappingOption "Run prompt" "rc"; - }; - }; - }; -} diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 508a8bf8..dd3a36e6 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -101,10 +101,7 @@ in { globals = mkOption { type = attrs; - default = { - mapleader = " "; - maplocalleader = ","; - }; + default = {}; example = {"some_variable" = 42;}; description = '' An attribute set containing global variable values