blob: 44795b87db6e81fd70d30b3d8f8de682a854721c [file] [log] [blame]
Skyler Greya7feb6e2022-08-26 06:51:55 +01001{
2 pkgs,
Skyler Grey2f9904e2022-09-05 03:18:02 +01003 system,
Skyler Greya7feb6e2022-08-26 06:51:55 +01004 lib,
Skyler Grey2f9904e2022-09-05 03:18:02 +01005 nixpkgs-minion,
Skyler Grey55f84552022-09-05 11:04:39 +01006 home,
Skyler Greyba17b652022-09-09 14:22:54 +01007 utils,
Skyler Greya7feb6e2022-08-26 06:51:55 +01008 ...
9}: {
10 programs.neovim = {
11 coc = {
12 enable = true;
13 settings = {
14 "suggest.noselect" = false;
15 "cSpell.checkOnlyEnabledfileTypes" = false;
Skyler Grey55f84552022-09-05 11:04:39 +010016 "cSpell.dictionaryDefinitions" = [
17 {
18 name = "imperative";
19 path = "${home.home.homeDirectory}/.local/share/cspell/dictionary.txt";
20 }
21 ];
22 "cSpell.dictionaries" = ["imperative"];
23 "git.enableGutters" = false; # We're using another plugin to do this
Skyler Greya7feb6e2022-08-26 06:51:55 +010024 "rust-analyzer.serverPath" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
25 languageserver = {
26 nix = {
27 command = "${pkgs.rnix-lsp}/bin/rnix-lsp";
28 filetypes = ["nix"];
29 };
Skyler Grey34e57982022-10-30 23:00:58 +000030 cs = {
31 command = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
32 filetypes = ["cs"];
33 rootPatterns = ["*.csproj" ".vim/" ".git/" ".hg/"];
34 };
Skyler Greya7feb6e2022-08-26 06:51:55 +010035 };
36 };
37 };
38 plugins = with pkgs.vimPlugins; [
39 # Language servers
40 coc-tsserver
41 coc-eslint
42 coc-rust-analyzer
43 coc-json
44 coc-jest
45 coc-css
Skyler Grey37e3c112022-09-09 08:15:08 +010046 coc-go
Skyler Greyb8300e72022-09-04 23:06:24 +010047 coc-markdownlint
Skyler Grey34e57982022-10-30 23:00:58 +000048 coc-texlab
Skyler Greya7feb6e2022-08-26 06:51:55 +010049
50 # Spellchecker
Skyler Grey2f9904e2022-09-05 03:18:02 +010051 nixpkgs-minion.legacyPackages.${system}.vimPlugins.coc-spell-checker
Skyler Greya7feb6e2022-08-26 06:51:55 +010052
53 # File explorer
54 coc-explorer
55 coc-git # TODO: Check if coc-git is still needed
56
57 # Snippet completion
58 coc-snippets
59 vim-snippets
60 ];
61 extraConfig = lib.pipe [./keybinds.vim ./theme.vim] [
62 (map builtins.readFile)
63 (builtins.concatStringsSep "\n")
64 ];
Skyler Grey34e57982022-10-30 23:00:58 +000065 extraPackages = with pkgs; [nodejs rustc go rust-analyzer texlab];
Skyler Greya7feb6e2022-08-26 06:51:55 +010066 };
Skyler Greyba17b652022-09-09 14:22:54 +010067 home.file = lib.pipe ./snippets [
68 builtins.readDir
69 builtins.attrNames
70 (map
71 (f: {
72 name = ".config/coc/ultisnips/${f}";
73 value = {
74 source = ./snippets + "/${f}";
75 target = ".config/coc/ultisnips/${f}";
76 };
77 }))
78 builtins.listToAttrs
79 lib.traceValSeq
80 ];
Skyler Greya7feb6e2022-08-26 06:51:55 +010081}