nixos-configs/common/home/neovim/coc.nix
matt1432 ac2b846662
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(nvim): split up lang configs in separate files
2024-05-07 22:49:00 -04:00

59 lines
1.3 KiB
Nix

{
config,
pkgs,
lib,
...
}: let
inherit (config.vars) neovimIde;
inherit (lib) fileContents;
inherit (pkgs) vimPlugins;
in
lib.mkIf neovimIde {
programs = {
neovim = {
coc = {
enable = true;
settings = {
colors.enable = true;
coc.preferences.formatOnType = true;
diagnostic.checkCurrentLine = true;
inlayHint.enable = false;
};
};
extraLuaConfig =
/*
lua
*/
''
vim.api.nvim_create_autocmd("FileType", {
pattern = 'hyprlang',
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
vim.api.nvim_create_user_command("Format", "call CocAction('format')", {});
-- Always show the signcolumn, otherwise it would shift the text each time
-- diagnostics appear/become resolved
vim.opt.signcolumn = 'yes';
'';
plugins = [
{
plugin = vimPlugins.coc-snippets;
type = "viml";
config = fileContents ./plugins/snippets.vim;
}
## Fzf
vimPlugins.coc-fzf
vimPlugins.coc-highlight
vimPlugins.coc-json
vimPlugins.coc-yaml
vimPlugins.coc-toml
];
};
};
}