blob: aafb41d08cd1d00bd9b7e0a07d8e714e83ea9f1d [file] [log] [blame]
Skyler Grey252927a2022-10-18 22:18:15 +01001{ pkgs
2, system
3, lib
4, nixpkgs-minion
5, home
6, utils
7, omnisharp-language-server
8, ...
Skyler Greya7feb6e2022-08-26 06:51:55 +01009}: {
10 programs.neovim = {
11 coc = {
12 enable = true;
13 settings = {
Skyler Grey3d1b4502022-10-31 00:11:11 +000014 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 Greyf066b512022-10-31 00:02:48 +000026 suggest.floatConfig = {
27 border = true;
28 rounded = true;
29 };
Skyler Grey3d1b4502022-10-31 00:11:11 +000030 "suggest.noselect" = true;
Skyler Greya7feb6e2022-08-26 06:51:55 +010031 "cSpell.checkOnlyEnabledfileTypes" = false;
Skyler Grey0c024ef2022-10-31 00:17:14 +000032 "suggest.virtualText" = true;
Skyler Grey55f84552022-09-05 11:04:39 +010033 "cSpell.dictionaryDefinitions" = [
34 {
35 name = "imperative";
36 path = "${home.home.homeDirectory}/.local/share/cspell/dictionary.txt";
37 }
38 ];
Skyler Grey252927a2022-10-18 22:18:15 +010039 "cSpell.dictionaries" = [ "imperative" ];
Skyler Greyc52aaae2023-04-17 08:14:21 +000040 "java.import.gradle.wrapper.enabled" = false;
Skyler Grey55f84552022-09-05 11:04:39 +010041 "git.enableGutters" = false; # We're using another plugin to do this
Skyler Greyf066b512022-10-31 00:02:48 +000042 "rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
Skyler Greyb2e68e42023-02-26 13:02:34 +000043 "rust-analyzer.lens.enable" = false;
44 "rust-analyzer.lens.debug.enable" = false;
Skyler Greyf066b512022-10-31 00:02:48 +000045 "omnisharp.path" = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
46 "markdownlint.config" = {
47 line-length = {
48 code_blocks = false;
49 tables = false;
50 };
Skyler Grey3d1b4502022-10-31 00:11:11 +000051 MD024.siblings_only = true;
Skyler Greye9e45852022-10-31 00:16:58 +000052 MD037 = false;
Skyler Greyf066b512022-10-31 00:02:48 +000053 };
Skyler Greya7feb6e2022-08-26 06:51:55 +010054 languageserver = {
55 nix = {
56 command = "${pkgs.rnix-lsp}/bin/rnix-lsp";
Skyler Grey252927a2022-10-18 22:18:15 +010057 filetypes = [ "nix" ];
Skyler Greya7feb6e2022-08-26 06:51:55 +010058 };
Skyler Grey1e098222022-11-05 10:12:12 +000059 haskell = {
60 command = "${pkgs.haskell-language-server}/bin/haskell-language-server-wrapper";
61 args = [ "--lsp" ];
62 rootPatterns = [
63 "*.cabal"
64 "stack.yaml"
65 "cabal.project"
66 "package.yaml"
67 "hie.yaml"
68 ];
69 filetypes = [ "haskell" "lhaskell" ];
70 settings = {
71 haskell = {
72 checkParents = "CheckOnSave";
73 checkProject = true;
74 maxCompletions = 40;
75 formattingProvider = "ormolu";
76 plugin = {
77 stan = { globalOn = true; };
78 };
79 };
80 };
81 };
Skyler Greyc52aaae2023-04-17 08:14:21 +000082 /* ccls = { */
83 /* command = "${pkgs.ccls}/bin/ccls"; */
84 /* filetypes = [ "c" "cc" "cpp" "c++" "objc" "objcpp" "C" ]; */
85 /* rootPatterns = [ ".ccls" "compile_commands.json" ".git/" ".vim/" ]; */
86 /* initializationOptions.cache.directory = "/tmp/ccls"; */
87 /* }; */
Skyler Greya7feb6e2022-08-26 06:51:55 +010088 };
Skyler Grey3d1b4502022-10-31 00:11:11 +000089 "snippets.extends" = {
Skyler Grey252927a2022-10-18 22:18:15 +010090 markdown = [ "tex" ];
Skyler Grey3d1b4502022-10-31 00:11:11 +000091 };
92 "snippets.autoTrigger" = false;
Skyler Grey0c024ef2022-10-31 00:17:14 +000093 "codeLens.enable" = true;
Skyler Greya7feb6e2022-08-26 06:51:55 +010094 };
95 };
96 plugins = with pkgs.vimPlugins; [
97 # Language servers
Skyler Greyc52aaae2023-04-17 08:14:21 +000098 coc-clangd
Skyler Greya7feb6e2022-08-26 06:51:55 +010099 coc-tsserver
100 coc-eslint
101 coc-rust-analyzer
102 coc-json
103 coc-jest
104 coc-css
Skyler Grey140fddc2023-01-27 09:43:42 +0000105 lsp_lines-nvim
Skyler Grey37e3c112022-09-09 08:15:08 +0100106 coc-go
Skyler Greyb8300e72022-09-04 23:06:24 +0100107 coc-markdownlint
Skyler Grey34e57982022-10-30 23:00:58 +0000108 coc-texlab
Skyler Grey3d1b4502022-10-31 00:11:11 +0000109 coc-pyright
Skyler Grey0c024ef2022-10-31 00:17:14 +0000110 coc-java
Skyler Greya7feb6e2022-08-26 06:51:55 +0100111
112 # Spellchecker
Skyler Greyb90fee52023-02-19 23:47:19 +0000113 coc-spell-checker
Skyler Greyf066b512022-10-31 00:02:48 +0000114 nixpkgs-minion.legacyPackages.${system}.vimPlugins.coc-omnisharp
Skyler Greya7feb6e2022-08-26 06:51:55 +0100115
116 # File explorer
117 coc-explorer
118 coc-git # TODO: Check if coc-git is still needed
119
120 # Snippet completion
Skyler Greya7feb6e2022-08-26 06:51:55 +0100121 vim-snippets
Skyler Grey81f4af62022-10-31 00:10:52 +0000122 coc-snippets
Skyler Greya7feb6e2022-08-26 06:51:55 +0100123 ];
Skyler Grey252927a2022-10-18 22:18:15 +0100124 extraConfig = lib.pipe [ ./keybinds.vim ./theme.vim ] [
Skyler Greya7feb6e2022-08-26 06:51:55 +0100125 (map builtins.readFile)
126 (builtins.concatStringsSep "\n")
127 ];
Skyler Greyf066b512022-10-31 00:02:48 +0000128 extraPackages = with pkgs; [
129 nodejs
Skyler Greyf066b512022-10-31 00:02:48 +0000130 go
Skyler Grey1e098222022-11-05 10:12:12 +0000131 stylish-haskell
132 haskell-language-server
133 (haskellPackages.ghcWithPackages (pkgs: with pkgs; [
134 dbus
135 monad-logger
136 xmonad-contrib
137 ]))
Skyler Greyf066b512022-10-31 00:02:48 +0000138 texlab
139 omnisharp-roslyn
Skyler Grey42ddbfb2023-04-06 09:46:36 +0000140 msbuild
141 dotnet-sdk
Skyler Grey0c024ef2022-10-31 00:17:14 +0000142 jdt-language-server
143 jdk
Skyler Grey3d1b4502022-10-31 00:11:11 +0000144 nodePackages.pyright
145 (python3.withPackages (pyPkgs:
146 with pyPkgs; [
147 pycodestyle
148 black
149 rope
150 ]))
Skyler Greyfab867f2023-01-25 21:45:01 +0000151 libclang
152 ccls
Skyler Greyf066b512022-10-31 00:02:48 +0000153 ];
Skyler Greya7feb6e2022-08-26 06:51:55 +0100154 };
Skyler Grey3d1b4502022-10-31 00:11:11 +0000155 home.file =
156 lib.pipe ./snippets [
157 builtins.readDir
158 builtins.attrNames
159 (map
160 (f: {
161 name = ".config/nvim/UltiSnips/${f}";
162 value = {
163 source = ./snippets + "/${f}";
164 target = ".config/nvim/UltiSnips/${f}";
165 };
166 }))
167 builtins.listToAttrs
Skyler Greyd9c7e1e2023-02-26 12:50:27 +0000168 /* lib.traceValSeq */
Skyler Grey3d1b4502022-10-31 00:11:11 +0000169 ]
170 // {
171 ".config/coc/placeholder".text = "";
172 };
Skyler Greya7feb6e2022-08-26 06:51:55 +0100173}