mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
feat(LSP): lspkind and sources
This commit is contained in:
parent
2df414b577
commit
104c21c904
11 changed files with 143 additions and 50 deletions
20
modules/lsp/lspkind/config.nix
Normal file
20
modules/lsp/lspkind/config.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lspkind.enable) {
|
||||
vim.startPlugins = ["lspkind"];
|
||||
vim.luaConfigRC.lspkind = nvim.dag.entryAnywhere ''
|
||||
local lspkind = require'lspkind'
|
||||
local lspkind_opts = {
|
||||
mode = '${cfg.lspkind.mode}'
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/lsp/lspkind/default.nix
Normal file
6
modules/lsp/lspkind/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./config.nix
|
||||
./lspkind.nix
|
||||
];
|
||||
}
|
22
modules/lsp/lspkind/lspkind.nix
Normal file
22
modules/lsp/lspkind/lspkind.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
lspkind = {
|
||||
enable = mkEnableOption "vscode-like pictograms for lsp [lspkind]";
|
||||
|
||||
mode = mkOption {
|
||||
description = "Defines how annotations are shown";
|
||||
type = with types; enum ["text" "text_symbol" "symbol_text" "symbol"];
|
||||
default = "symbol_text";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue