2024-05-07 22:49:00 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
2024-11-22 02:48:41 -05:00
|
|
|
pkgs,
|
2024-05-07 22:49:00 -04:00
|
|
|
...
|
|
|
|
}: let
|
2024-08-31 19:16:06 -04:00
|
|
|
inherit (lib) mkIf;
|
2024-11-22 02:48:41 -05:00
|
|
|
|
|
|
|
cfg = config.programs.neovim;
|
2024-05-07 22:49:00 -04:00
|
|
|
in
|
2024-11-22 02:48:41 -05:00
|
|
|
mkIf cfg.enableIde {
|
2024-05-07 22:49:00 -04:00
|
|
|
programs = {
|
|
|
|
neovim = {
|
2024-08-31 19:16:06 -04:00
|
|
|
extraPackages = builtins.attrValues {
|
|
|
|
inherit
|
|
|
|
(pkgs)
|
|
|
|
gcc
|
|
|
|
clang-tools
|
|
|
|
cmake-language-server
|
|
|
|
;
|
|
|
|
};
|
2024-05-07 22:49:00 -04:00
|
|
|
|
2024-05-11 15:33:38 -04:00
|
|
|
extraLuaConfig =
|
2024-06-09 22:49:30 -04:00
|
|
|
# lua
|
2024-05-11 15:33:38 -04:00
|
|
|
''
|
2024-06-24 11:33:02 -04:00
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = { 'cpp' , 'c'},
|
|
|
|
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
|
|
|
});
|
|
|
|
|
2024-05-11 15:33:38 -04:00
|
|
|
local lsp = require('lspconfig');
|
|
|
|
|
2024-07-28 02:54:34 -04:00
|
|
|
lsp.cmake.setup({
|
|
|
|
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
|
|
|
});
|
|
|
|
|
|
|
|
lsp.clangd.setup({
|
|
|
|
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
2024-05-11 15:33:38 -04:00
|
|
|
|
|
|
|
handlers = require('lsp-status').extensions.clangd.setup(),
|
|
|
|
on_attach = function(_, bufnr)
|
|
|
|
require("clangd_extensions.inlay_hints").setup_autocmd()
|
|
|
|
require("clangd_extensions.inlay_hints").set_inlay_hints()
|
|
|
|
end,
|
2024-07-28 02:54:34 -04:00
|
|
|
});
|
2024-05-11 15:33:38 -04:00
|
|
|
'';
|
|
|
|
|
2024-08-31 19:16:06 -04:00
|
|
|
plugins = builtins.attrValues {
|
|
|
|
inherit (pkgs.vimPlugins) clangd_extensions-nvim;
|
|
|
|
};
|
2024-05-07 22:49:00 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|