Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 1 | { |
| 2 | pkgs, |
Skyler Grey | 2f9904e | 2022-09-05 03:18:02 +0100 | [diff] [blame] | 3 | system, |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 4 | lib, |
Skyler Grey | 2f9904e | 2022-09-05 03:18:02 +0100 | [diff] [blame] | 5 | nixpkgs-minion, |
Skyler Grey | 55f8455 | 2022-09-05 11:04:39 +0100 | [diff] [blame] | 6 | home, |
Skyler Grey | ba17b65 | 2022-09-09 14:22:54 +0100 | [diff] [blame] | 7 | utils, |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 8 | omnisharp-language-server, |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 9 | ... |
| 10 | }: { |
| 11 | programs.neovim = { |
| 12 | coc = { |
| 13 | enable = true; |
| 14 | settings = { |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 15 | suggest.floatConfig = { |
| 16 | border = true; |
| 17 | rounded = true; |
| 18 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 19 | "suggest.noselect" = false; |
| 20 | "cSpell.checkOnlyEnabledfileTypes" = false; |
Skyler Grey | 55f8455 | 2022-09-05 11:04:39 +0100 | [diff] [blame] | 21 | "cSpell.dictionaryDefinitions" = [ |
| 22 | { |
| 23 | name = "imperative"; |
| 24 | path = "${home.home.homeDirectory}/.local/share/cspell/dictionary.txt"; |
| 25 | } |
| 26 | ]; |
| 27 | "cSpell.dictionaries" = ["imperative"]; |
| 28 | "git.enableGutters" = false; # We're using another plugin to do this |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 29 | "rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer"; |
| 30 | "omnisharp.path" = "${pkgs.omnisharp-roslyn}/bin/OmniSharp"; |
| 31 | "markdownlint.config" = { |
| 32 | line-length = { |
| 33 | code_blocks = false; |
| 34 | tables = false; |
| 35 | }; |
| 36 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 37 | languageserver = { |
| 38 | nix = { |
| 39 | command = "${pkgs.rnix-lsp}/bin/rnix-lsp"; |
| 40 | filetypes = ["nix"]; |
| 41 | }; |
| 42 | }; |
| 43 | }; |
| 44 | }; |
| 45 | plugins = with pkgs.vimPlugins; [ |
| 46 | # Language servers |
| 47 | coc-tsserver |
| 48 | coc-eslint |
| 49 | coc-rust-analyzer |
| 50 | coc-json |
| 51 | coc-jest |
| 52 | coc-css |
Skyler Grey | 37e3c11 | 2022-09-09 08:15:08 +0100 | [diff] [blame] | 53 | coc-go |
Skyler Grey | b8300e7 | 2022-09-04 23:06:24 +0100 | [diff] [blame] | 54 | coc-markdownlint |
Skyler Grey | 34e5798 | 2022-10-30 23:00:58 +0000 | [diff] [blame] | 55 | coc-texlab |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 56 | |
| 57 | # Spellchecker |
Skyler Grey | 2f9904e | 2022-09-05 03:18:02 +0100 | [diff] [blame] | 58 | nixpkgs-minion.legacyPackages.${system}.vimPlugins.coc-spell-checker |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 59 | nixpkgs-minion.legacyPackages.${system}.vimPlugins.coc-omnisharp |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 60 | |
| 61 | # File explorer |
| 62 | coc-explorer |
| 63 | coc-git # TODO: Check if coc-git is still needed |
| 64 | |
| 65 | # Snippet completion |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 66 | ultisnips |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 67 | vim-snippets |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 68 | coc-ultisnips |
| 69 | |
| 70 | # General utils |
| 71 | coc-pairs |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 72 | ]; |
| 73 | extraConfig = lib.pipe [./keybinds.vim ./theme.vim] [ |
| 74 | (map builtins.readFile) |
| 75 | (builtins.concatStringsSep "\n") |
| 76 | ]; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 77 | extraPackages = with pkgs; [ |
| 78 | nodejs |
| 79 | rustc |
| 80 | go |
| 81 | rust-analyzer |
| 82 | texlab |
| 83 | omnisharp-roslyn |
| 84 | ]; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 85 | }; |
Skyler Grey | ba17b65 | 2022-09-09 14:22:54 +0100 | [diff] [blame] | 86 | home.file = lib.pipe ./snippets [ |
| 87 | builtins.readDir |
| 88 | builtins.attrNames |
| 89 | (map |
| 90 | (f: { |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 91 | name = ".config/nvim/UltiSnips/${f}"; |
Skyler Grey | ba17b65 | 2022-09-09 14:22:54 +0100 | [diff] [blame] | 92 | value = { |
| 93 | source = ./snippets + "/${f}"; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 94 | target = ".config/nvim/UltiSnips/${f}"; |
Skyler Grey | ba17b65 | 2022-09-09 14:22:54 +0100 | [diff] [blame] | 95 | }; |
| 96 | })) |
| 97 | builtins.listToAttrs |
| 98 | lib.traceValSeq |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 99 | ] // { |
| 100 | ".config/coc/placeholder".text = ""; |
| 101 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 102 | } |