Neovim, Add c language support
This commit is contained in:
parent
92211cc1be
commit
14b3dab476
4 changed files with 11 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
|||
enable = lib.mkEnableOption "Enables neovim";
|
||||
languages = {
|
||||
nix.enable = lib.mkEnableOption "Enables nix support";
|
||||
c.enable = lib.mkEnableOption "Enables c support";
|
||||
};
|
||||
plugins = {
|
||||
comments.enable = lib.mkEnableOption "Enables nvim-comment";
|
||||
|
|
@ -45,6 +46,7 @@
|
|||
|
||||
extraPackages = with pkgs; [
|
||||
(lib.mkIf config.neovim.languages.nix.enable nil)
|
||||
(lib.mkIf config.neovim.languages.c.enable libclang)
|
||||
];
|
||||
|
||||
# Additional packages are added through imports
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@
|
|||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
'' + lib.strings.optionalString cfgl.nix.enable ''
|
||||
require('lspconfig').nil_ls.setup {}
|
||||
'' + lib.strings.optionalString cfgl.c.enable ''
|
||||
require('lspconfig').clangd.setup {}
|
||||
'';
|
||||
in with pkgs.vimPlugins; [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,12 @@ in {
|
|||
}
|
||||
'';
|
||||
|
||||
treeplugs = p: lib.lists.optional cfgl.nix.enable p.tree-sitter-nix;
|
||||
# I've tried many things, and can't get treesitter plugins changing
|
||||
# dynamically. For not just have them always loaded regardless of config
|
||||
treeplugs = p: [
|
||||
p.tree-sitter-nix
|
||||
p.tree-sitter-c
|
||||
];
|
||||
in with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = (nvim-treesitter.withPlugins treeplugs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue