From c20456e3a103de224795d5c64bb4e931055e5c90 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 6 Jun 2023 03:05:05 +0300 Subject: [PATCH] feat: vim-illuminate --- extra.nix | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ lib/types/plugins.nix | 1 + modules/ui/default.nix | 1 + modules/ui/illuminate/config.nix | 17 +++++++++++++++++ modules/ui/illuminate/default.nix | 6 ++++++ modules/ui/illuminate/illuminate.nix | 11 +++++++++++ 8 files changed, 59 insertions(+) create mode 100644 modules/ui/illuminate/config.nix create mode 100644 modules/ui/illuminate/default.nix create mode 100644 modules/ui/illuminate/illuminate.nix diff --git a/extra.nix b/extra.nix index 9afba32..01d4282 100644 --- a/extra.nix +++ b/extra.nix @@ -180,6 +180,7 @@ inputs: let noice.enable = true; colorizer.enable = true; modes-nvim.enable = true; + illuminate.enable = true; smartcolumn = { enable = true; columnAt.languages = { diff --git a/flake.lock b/flake.lock index 08d8c5b..5d222ac 100644 --- a/flake.lock +++ b/flake.lock @@ -1372,6 +1372,7 @@ "toggleterm-nvim": "toggleterm-nvim", "tokyonight": "tokyonight", "trouble": "trouble", + "vim-illuminate": "vim-illuminate", "vim-markdown": "vim-markdown", "vim-repeat": "vim-repeat", "vim-startify": "vim-startify", @@ -1668,6 +1669,22 @@ "type": "github" } }, + "vim-illuminate": { + "flake": false, + "locked": { + "lastModified": 1679187974, + "narHash": "sha256-8dL3cBjQ2iY4D4gTxKVVmOGhxcSSRuDBvmEwwFIbWsQ=", + "owner": "RRethy", + "repo": "vim-illuminate", + "rev": "a2907275a6899c570d16e95b9db5fd921c167502", + "type": "github" + }, + "original": { + "owner": "RRethy", + "repo": "vim-illuminate", + "type": "github" + } + }, "vim-markdown": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 62053c6..00631bd 100644 --- a/flake.nix +++ b/flake.nix @@ -457,6 +457,11 @@ flake = false; }; + vim-illuminate = { + url = "github:RRethy/vim-illuminate"; + flake = false; + }; + # Assistant copilot-lua = { url = "github:zbirenbaum/copilot.lua"; diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index c8fc593..6267dc7 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -82,6 +82,7 @@ with lib; let "elixir-ls" "elixir-tools" "nvim-colorizer-lua" + "vim-illuminate" ]; # You can either use the name of the plugin or a package. pluginsType = with types; diff --git a/modules/ui/default.nix b/modules/ui/default.nix index 286b3ce..980a04a 100644 --- a/modules/ui/default.nix +++ b/modules/ui/default.nix @@ -5,5 +5,6 @@ _: { ./notifications ./smartcolumn ./colorizer + ./illuminate ]; } diff --git a/modules/ui/illuminate/config.nix b/modules/ui/illuminate/config.nix new file mode 100644 index 0000000..0795d9d --- /dev/null +++ b/modules/ui/illuminate/config.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.ui.illuminate; +in { + config = mkIf cfg.enable { + vim.startPlugins = ["vim-illuminate"]; + + vim.luaConfigRC.vim-illuminate = + nvim.dag.entryAnywhere '' + ''; + }; +} diff --git a/modules/ui/illuminate/default.nix b/modules/ui/illuminate/default.nix new file mode 100644 index 0000000..366bb7b --- /dev/null +++ b/modules/ui/illuminate/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./config.nix + ./illuminate.nix + ]; +} diff --git a/modules/ui/illuminate/illuminate.nix b/modules/ui/illuminate/illuminate.nix new file mode 100644 index 0000000..952e28c --- /dev/null +++ b/modules/ui/illuminate/illuminate.nix @@ -0,0 +1,11 @@ +{ + config, + lib, + ... +}: +with lib; +with builtins; { + options.vim.ui.illuminate = { + enable = mkEnableOption "vim-illuminate: automatically highlight other uses of the word under the cursor"; + }; +}