mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
feat: apply new module format to lsp plugins
This commit is contained in:
parent
e09ccfd014
commit
067b523897
18 changed files with 175 additions and 31 deletions
23
modules/lsp/lightbulb/config.nix
Normal file
23
modules/lsp/lightbulb/config.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
|
||||
vim.startPlugins = ["nvim-lightbulb"];
|
||||
|
||||
vim.configRC.lightbulb = nvim.dag.entryAnywhere ''
|
||||
autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()
|
||||
'';
|
||||
|
||||
vim.luaConfigRC.lightbulb = nvim.dag.entryAnywhere ''
|
||||
-- Enable trouble diagnostics viewer
|
||||
require'nvim-lightbulb'.setup()
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/lsp/lightbulb/default.nix
Normal file
6
modules/lsp/lightbulb/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./lightbulb.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
16
modules/lsp/lightbulb/lightbulb.nix
Normal file
16
modules/lsp/lightbulb/lightbulb.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
lightbulb = {
|
||||
enable = mkEnableOption "lightbulb for code actions. Requires emoji font";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue