feat(LSP): lspkind and sources

This commit is contained in:
NotAShelf 2023-04-18 01:48:44 +03:00
commit 104c21c904
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
11 changed files with 143 additions and 50 deletions

View file

@ -14,6 +14,7 @@ _: {
./trouble
./lsp-signature
./lightbulb
./lspkind
# flutter-tools
./flutter-tools-nvim

View 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}'
}
'';
};
}

View file

@ -0,0 +1,6 @@
_: {
imports = [
./config.nix
./lspkind.nix
];
}

View 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";
};
};
};
}