only enable nvim_lsp cmp source on desktop
This commit is contained in:
parent
99f633d3df
commit
324ce79bd6
3 changed files with 26 additions and 16 deletions
|
@ -89,6 +89,8 @@ in {
|
|||
"config.undodir"
|
||||
];
|
||||
|
||||
vim.g.isDesktop = config.isDesktop;
|
||||
|
||||
output.path.path = with pkgs; [ripgrep];
|
||||
};
|
||||
options.isDesktop = lib.options.mkEnableOption "desktop integration and LSP";
|
||||
|
|
|
@ -1,12 +1,22 @@
|
|||
{pkgs, ...}: {
|
||||
output.plugins = with pkgs.vimPlugins; [
|
||||
nvim-cmp
|
||||
cmp-cmdline
|
||||
cmp-path
|
||||
cmp-buffer
|
||||
cmp-nvim-lsp
|
||||
cmp_luasnip
|
||||
cmp-git
|
||||
];
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
output.plugins = with pkgs.vimPlugins;
|
||||
[
|
||||
nvim-cmp
|
||||
cmp-cmdline
|
||||
cmp-path
|
||||
cmp-buffer
|
||||
cmp_luasnip
|
||||
cmp-git
|
||||
]
|
||||
++ (
|
||||
if config.isDesktop
|
||||
then [cmp-nvim-lsp]
|
||||
else []
|
||||
);
|
||||
extraLuaModules = ["config.cmp"];
|
||||
}
|
||||
|
|
|
@ -19,12 +19,10 @@ cmp.setup({
|
|||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'vsnip' }, -- For vsnip users.
|
||||
-- { name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
sources = cmp.config.sources(
|
||||
vim.g.isDesktop and {{ name = 'nvim_lsp' }} or {},
|
||||
{
|
||||
{ name = 'luasnip' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue