mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 11:21:35 +00:00
feat: refactor and separate LSP/language configurations
This commit is contained in:
parent
7a71f06763
commit
6b512f132a
30 changed files with 1266 additions and 522 deletions
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
|
@ -6,15 +7,22 @@
|
|||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.autocomplete;
|
||||
builtSources =
|
||||
concatMapStringsSep "\n" (x: "{ name = '${x}'},") cfg.sources;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"vim-vsnip"
|
||||
"nvim-cmp"
|
||||
"cmp-buffer"
|
||||
"cmp-vsnip"
|
||||
"cmp-path"
|
||||
"cmp-treesitter"
|
||||
];
|
||||
|
||||
vim.autocomplete.sources = [
|
||||
"nvim-cmp"
|
||||
"vsnip"
|
||||
"buffer"
|
||||
"path"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (nvim.dag.entryAnywhere ''
|
||||
|
@ -35,12 +43,7 @@ in {
|
|||
end,
|
||||
},
|
||||
sources = {
|
||||
${optionalString (config.vim.lsp.enable) "{ name = 'nvim_lsp' },"}
|
||||
${optionalString (config.vim.lsp.rust.enable) "{ name = 'crates' },"}
|
||||
{ name = 'vsnip' },
|
||||
{ name = 'treesitter' },
|
||||
{ name = 'path' },
|
||||
{ name = 'buffer' },
|
||||
${builtSources}
|
||||
},
|
||||
mapping = {
|
||||
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue