nixos-configs/common/home/neovim/langs/default.nix

74 lines
1.7 KiB
Nix
Raw Normal View History

2024-05-08 23:04:16 -04:00
{
config,
lib,
pkgs,
...
}: let
inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins;
in {
imports = [
./bash.nix
./clang.nix
./hyprlang.nix
./java.nix
./lua.nix
./markdown.nix
./nix.nix
./python.nix
./web.nix
];
2024-05-08 23:04:16 -04:00
programs = lib.mkIf neovimIde {
neovim = {
extraLuaConfig = lib.mkBefore
/*
lua
*/
''
-- Start completion / snippet stuff
2024-05-08 23:56:56 -04:00
vim.g.coq_settings = { auto_start = 'shut-up' };
2024-05-08 23:04:16 -04:00
-- Add formatting cmd
vim.api.nvim_create_user_command(
'Format',
function()
vim.lsp.buf.format({ async = true });
end,
{}
);
2024-05-08 23:56:56 -04:00
-- LSP-Status setup
local lsp_status = require('lsp-status');
lsp_status.register_progress();
2024-05-08 23:04:16 -04:00
-- Remove LSP highlighting to use Treesitter
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
2024-05-08 23:56:56 -04:00
local client = vim.lsp.get_client_by_id(args.data.client_id);
client.server_capabilities.semanticTokensProvider = nil;
lsp_status.on_attach(client);
2024-05-08 23:04:16 -04:00
end,
});
2024-05-09 09:12:01 -04:00
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
});
require('lsp_lines').setup();
2024-05-08 23:04:16 -04:00
'';
plugins = [
vimPlugins.nvim-lspconfig
2024-05-09 09:12:01 -04:00
2024-05-08 23:04:16 -04:00
vimPlugins.coq_nvim
vimPlugins.coq-artifacts
vimPlugins.coq-thirdparty
2024-05-09 09:12:01 -04:00
2024-05-08 23:56:56 -04:00
vimPlugins.lsp-status-nvim
2024-05-09 09:12:01 -04:00
vimPlugins.lsp_lines-nvim
2024-05-08 23:04:16 -04:00
];
};
};
}