neovim-flake/modules/plugins/lsp/lightbulb/config.nix
Omar Abragh 73660af2e3
lightbulb: add setupOpts option (#492)
Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com>
Co-authored-by: raf <raf@notashelf.dev>
2024-12-11 00:00:51 +03:00

24 lines
585 B
Nix

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.lsp;
in {
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
vim = {
startPlugins = ["nvim-lightbulb"];
pluginRC.lightbulb = entryAnywhere ''
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
-- Enable trouble diagnostics viewer
require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts})
'';
};
};
}