Files
nix-config/home/autumn/programs/nvim/cmp/lsp.nix
T
2025-12-01 17:54:36 -05:00

126 lines
3.0 KiB
Nix

{ ... }:
{
programs.nixvim.plugins = {
lsp = {
enable = true;
inlayHints = true;
servers = {
asm_lsp.enable = true;
clangd = {
enable = true;
cmd = [
"clangd"
];
};
cssls.enable = true;
eslint.enable = true;
lua_ls = {
enable = true;
settings.telemetry.enable = false;
};
hls = {
enable = true;
installGhc = true;
settings.haskell = {
formattingProvider = "fourmolu";
};
};
html.enable = true;
jsonls.enable = true;
mlir_lsp_server.enable = true;
nil_ls.enable = true;
nixd.enable = true;
nushell.enable = true;
ocamllsp.enable = true;
pyright.enable = true;
ts_ls.enable = true;
zls.enable = true;
};
};
cmp-emoji = {
enable = true;
};
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = {
ghost_text = true;
};
performance = {
debounce = 60;
fetchingTimeout = 200;
};
snippet = {
expand = "luasnip";
};
formatting = {
fields = [
"kind"
"abbr"
"menu"
];
};
sources = [
{ name = "nvim_lsp"; }
{ name = "emoji"; }
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
{
name = "path"; # file system paths
keywordLength = 3;
}
{
name = "luasnip"; # snippets
keywordLength = 3;
}
];
window = {
completion.__raw = "cmp.config.window.bordered()";
documentation.__raw = "cmp.config.window.bordered()";
};
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<C-e>" = "cmp.mapping.abort()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
};
};
};
cmp-nvim-lsp = {
enable = true;
}; # lsp
cmp-buffer = {
enable = true;
};
cmp-path = {
enable = true;
}; # file system paths
cmp_luasnip = {
enable = true;
}; # snippets
cmp-cmdline = {
enable = false;
}; # autocomplete for cmdline
luasnip = {
enable = true;
settings = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
};
};
}