feat(nvim): add rust lsp
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-05-18 19:43:43 -04:00
parent 8d04980e50
commit 682db6c529
2 changed files with 37 additions and 0 deletions

View file

@ -17,6 +17,7 @@ in {
./markdown.nix ./markdown.nix
./nix.nix ./nix.nix
./python.nix ./python.nix
./rust.nix
./web.nix ./web.nix
]; ];

View file

@ -0,0 +1,36 @@
{
config,
pkgs,
lib,
...
}: let
inherit (config.vars) neovimIde;
in
lib.mkIf neovimIde {
programs = {
neovim = {
extraPackages = with pkgs; [
cargo
rustc
rust-analyzer
rustfmt
];
extraLuaConfig =
/*
lua
*/
''
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'rust' },
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
local lsp = require('lspconfig');
local coq = require('coq');
lsp.rust_analyzer.setup(coq.lsp_ensure_capabilities({}));
'';
};
};
}