feat(nvim): add rust lsp
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
8d04980e50
commit
682db6c529
2 changed files with 37 additions and 0 deletions
|
@ -17,6 +17,7 @@ in {
|
||||||
./markdown.nix
|
./markdown.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./python.nix
|
./python.nix
|
||||||
|
./rust.nix
|
||||||
./web.nix
|
./web.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
36
common/home/neovim/langs/rust.nix
Normal file
36
common/home/neovim/langs/rust.nix
Normal 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({}));
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue