Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { pkgs |
| 2 | , system |
| 3 | , lib |
| 4 | , nixpkgs-minion |
| 5 | , home |
| 6 | , utils |
| 7 | , omnisharp-language-server |
| 8 | , ... |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 9 | }: { |
| 10 | programs.neovim = { |
| 11 | coc = { |
| 12 | enable = true; |
| 13 | settings = { |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 14 | diagnostic.floatConfig = { |
| 15 | border = true; |
| 16 | rounded = true; |
| 17 | }; |
| 18 | signature.floatConfig = { |
| 19 | border = true; |
| 20 | rounded = true; |
| 21 | }; |
| 22 | hover.floatConfig = { |
| 23 | border = true; |
| 24 | rounded = true; |
| 25 | }; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 26 | suggest.floatConfig = { |
| 27 | border = true; |
| 28 | rounded = true; |
| 29 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 30 | "suggest.noselect" = true; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 31 | "cSpell.checkOnlyEnabledfileTypes" = false; |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 32 | "suggest.virtualText" = true; |
Skyler Grey | 55f8455 | 2022-09-05 11:04:39 +0100 | [diff] [blame] | 33 | "cSpell.dictionaryDefinitions" = [ |
| 34 | { |
| 35 | name = "imperative"; |
| 36 | path = "${home.home.homeDirectory}/.local/share/cspell/dictionary.txt"; |
| 37 | } |
| 38 | ]; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 39 | "cSpell.dictionaries" = [ "imperative" ]; |
Skyler Grey | 55f8455 | 2022-09-05 11:04:39 +0100 | [diff] [blame] | 40 | "git.enableGutters" = false; # We're using another plugin to do this |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 41 | "rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer"; |
Skyler Grey | b2e68e4 | 2023-02-26 13:02:34 +0000 | [diff] [blame] | 42 | "rust-analyzer.lens.enable" = false; |
| 43 | "rust-analyzer.lens.debug.enable" = false; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 44 | "omnisharp.path" = "${pkgs.omnisharp-roslyn}/bin/OmniSharp"; |
| 45 | "markdownlint.config" = { |
| 46 | line-length = { |
| 47 | code_blocks = false; |
| 48 | tables = false; |
| 49 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 50 | MD024.siblings_only = true; |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 51 | MD037 = false; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 52 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 53 | languageserver = { |
| 54 | nix = { |
| 55 | command = "${pkgs.rnix-lsp}/bin/rnix-lsp"; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 56 | filetypes = [ "nix" ]; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 57 | }; |
Skyler Grey | 1e09822 | 2022-11-05 10:12:12 +0000 | [diff] [blame] | 58 | haskell = { |
| 59 | command = "${pkgs.haskell-language-server}/bin/haskell-language-server-wrapper"; |
| 60 | args = [ "--lsp" ]; |
| 61 | rootPatterns = [ |
| 62 | "*.cabal" |
| 63 | "stack.yaml" |
| 64 | "cabal.project" |
| 65 | "package.yaml" |
| 66 | "hie.yaml" |
| 67 | ]; |
| 68 | filetypes = [ "haskell" "lhaskell" ]; |
| 69 | settings = { |
| 70 | haskell = { |
| 71 | checkParents = "CheckOnSave"; |
| 72 | checkProject = true; |
| 73 | maxCompletions = 40; |
| 74 | formattingProvider = "ormolu"; |
| 75 | plugin = { |
| 76 | stan = { globalOn = true; }; |
| 77 | }; |
| 78 | }; |
| 79 | }; |
| 80 | }; |
Skyler Grey | fab867f | 2023-01-25 21:45:01 +0000 | [diff] [blame] | 81 | ccls = { |
| 82 | command = "${pkgs.ccls}/bin/ccls"; |
| 83 | filetypes = [ "c" "cc" "cpp" "c++" "objc" "objcpp" "C" ]; |
| 84 | rootPatterns = [ ".ccls" "compile_commands.json" ".git/" ".vim/" ]; |
| 85 | initializationOptions.cache.directory = "/tmp/ccls"; |
| 86 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 87 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 88 | "snippets.extends" = { |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 89 | markdown = [ "tex" ]; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 90 | }; |
| 91 | "snippets.autoTrigger" = false; |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 92 | "codeLens.enable" = true; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 93 | }; |
| 94 | }; |
| 95 | plugins = with pkgs.vimPlugins; [ |
| 96 | # Language servers |
| 97 | coc-tsserver |
| 98 | coc-eslint |
| 99 | coc-rust-analyzer |
| 100 | coc-json |
| 101 | coc-jest |
| 102 | coc-css |
Skyler Grey | 140fddc | 2023-01-27 09:43:42 +0000 | [diff] [blame] | 103 | lsp_lines-nvim |
Skyler Grey | 37e3c11 | 2022-09-09 08:15:08 +0100 | [diff] [blame] | 104 | coc-go |
Skyler Grey | b8300e7 | 2022-09-04 23:06:24 +0100 | [diff] [blame] | 105 | coc-markdownlint |
Skyler Grey | 34e5798 | 2022-10-30 23:00:58 +0000 | [diff] [blame] | 106 | coc-texlab |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 107 | coc-pyright |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 108 | coc-java |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 109 | |
| 110 | # Spellchecker |
Skyler Grey | b90fee5 | 2023-02-19 23:47:19 +0000 | [diff] [blame] | 111 | coc-spell-checker |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 112 | nixpkgs-minion.legacyPackages.${system}.vimPlugins.coc-omnisharp |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 113 | |
| 114 | # File explorer |
| 115 | coc-explorer |
| 116 | coc-git # TODO: Check if coc-git is still needed |
| 117 | |
| 118 | # Snippet completion |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 119 | vim-snippets |
Skyler Grey | 81f4af6 | 2022-10-31 00:10:52 +0000 | [diff] [blame] | 120 | coc-snippets |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 121 | ]; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 122 | extraConfig = lib.pipe [ ./keybinds.vim ./theme.vim ] [ |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 123 | (map builtins.readFile) |
| 124 | (builtins.concatStringsSep "\n") |
| 125 | ]; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 126 | extraPackages = with pkgs; [ |
| 127 | nodejs |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 128 | go |
Skyler Grey | 1e09822 | 2022-11-05 10:12:12 +0000 | [diff] [blame] | 129 | stylish-haskell |
| 130 | haskell-language-server |
| 131 | (haskellPackages.ghcWithPackages (pkgs: with pkgs; [ |
| 132 | dbus |
| 133 | monad-logger |
| 134 | xmonad-contrib |
| 135 | ])) |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 136 | texlab |
| 137 | omnisharp-roslyn |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 138 | jdt-language-server |
| 139 | jdk |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 140 | nodePackages.pyright |
| 141 | (python3.withPackages (pyPkgs: |
| 142 | with pyPkgs; [ |
| 143 | pycodestyle |
| 144 | black |
| 145 | rope |
| 146 | ])) |
Skyler Grey | fab867f | 2023-01-25 21:45:01 +0000 | [diff] [blame] | 147 | libclang |
| 148 | ccls |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 149 | ]; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 150 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 151 | home.file = |
| 152 | lib.pipe ./snippets [ |
| 153 | builtins.readDir |
| 154 | builtins.attrNames |
| 155 | (map |
| 156 | (f: { |
| 157 | name = ".config/nvim/UltiSnips/${f}"; |
| 158 | value = { |
| 159 | source = ./snippets + "/${f}"; |
| 160 | target = ".config/nvim/UltiSnips/${f}"; |
| 161 | }; |
| 162 | })) |
| 163 | builtins.listToAttrs |
Skyler Grey | d9c7e1e | 2023-02-26 12:50:27 +0000 | [diff] [blame] | 164 | /* lib.traceValSeq */ |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 165 | ] |
| 166 | // { |
| 167 | ".config/coc/placeholder".text = ""; |
| 168 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 169 | } |