diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/default.nix | 1 | ||||
-rw-r--r-- | common/nixvim.nix | 1187 | ||||
-rw-r--r-- | common/vim.nix | 190 |
3 files changed, 599 insertions, 779 deletions
diff --git a/common/default.nix b/common/default.nix index a791e8d..871c4da 100644 --- a/common/default.nix +++ b/common/default.nix | |||
@@ -13,7 +13,6 @@ inputs: | |||
13 | (import ./theme.nix inputs) | 13 | (import ./theme.nix inputs) |
14 | (import ./tinc.nix inputs) | 14 | (import ./tinc.nix inputs) |
15 | (import ./unfree.nix inputs) | 15 | (import ./unfree.nix inputs) |
16 | (import ./vim.nix inputs) | ||
17 | (import ./zram.nix inputs) | 16 | (import ./zram.nix inputs) |
18 | ]; | 17 | ]; |
19 | 18 | ||
diff --git a/common/nixvim.nix b/common/nixvim.nix index 5e87ad9..aef8380 100644 --- a/common/nixvim.nix +++ b/common/nixvim.nix | |||
@@ -18,676 +18,687 @@ in | |||
18 | }; | 18 | }; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | config.programs.nixvim = { | 21 | config = { |
22 | # enable = true; | 22 | programs.nixvim = { |
23 | luaLoader.enable = true; | 23 | # enable = true; |
24 | 24 | luaLoader.enable = true; | |
25 | globals = { | 25 | |
26 | mapleader = ";"; | 26 | globals = { |
27 | maplocalleader = ","; | 27 | mapleader = ";"; |
28 | polyglot_disabled = [ | 28 | maplocalleader = ","; |
29 | # ftdetect messes up `vim.filetype.add` | 29 | polyglot_disabled = [ |
30 | "ftdetect" | 30 | # ftdetect messes up `vim.filetype.add` |
31 | "autoindent" | 31 | "ftdetect" |
32 | "sensible" | 32 | "autoindent" |
33 | ]; | 33 | "sensible" |
34 | }; | 34 | ]; |
35 | |||
36 | opts = { | ||
37 | backup = true; | ||
38 | # Use `//` at the end to store the absolute file name | ||
39 | backupdir.__raw = "vim.fn.stdpath('data') .. '/backup//'"; | ||
40 | colorcolumn = "80"; | ||
41 | completeopt = [ | ||
42 | "menu" | ||
43 | "menuone" | ||
44 | "noinsert" | ||
45 | "noselect" | ||
46 | ]; | ||
47 | cursorline = true; | ||
48 | diffopt = [ | ||
49 | "internal" | ||
50 | "filler" | ||
51 | "closeoff" | ||
52 | "linematch:60" | ||
53 | ]; | ||
54 | grepprg = "${lib.getExe pkgs.ripgrep} --vimgrep --smart-case"; | ||
55 | ignorecase = true; | ||
56 | inccommand = "split"; | ||
57 | list = true; | ||
58 | listchars = { | ||
59 | extends = ">"; | ||
60 | nbsp = "+"; | ||
61 | precedes = "<"; | ||
62 | tab = " "; | ||
63 | trail = "-"; | ||
64 | }; | 35 | }; |
65 | scrolloff = 3; | ||
66 | shiftwidth = 4; | ||
67 | shortmess = "ncAxoTOtfFli"; | ||
68 | showmode = false; | ||
69 | sidescrolloff = 5; | ||
70 | smartcase = true; | ||
71 | smartindent = true; | ||
72 | tabstop = 4; | ||
73 | title = true; | ||
74 | undofile = true; | ||
75 | updatetime = 1000; | ||
76 | wildmode = [ | ||
77 | "longest:full" | ||
78 | "full" | ||
79 | ]; | ||
80 | }; | ||
81 | 36 | ||
82 | colorschemes.gruvbox = { | 37 | opts = { |
83 | enable = true; | 38 | backup = true; |
84 | 39 | # Use `//` at the end to store the absolute file name | |
85 | settings = { | 40 | backupdir.__raw = "vim.fn.stdpath('data') .. '/backup//'"; |
86 | # bold = true; | 41 | colorcolumn = "80"; |
87 | # italics = true; | 42 | completeopt = [ |
88 | # underline = true; | 43 | "menu" |
89 | # undercurl = true; | 44 | "menuone" |
90 | italic.strings = false; | 45 | "noinsert" |
91 | overrides = { | 46 | "noselect" |
92 | GitSignsAdd.link = "GruvboxGreenSign"; | 47 | ]; |
93 | GitSignsChange.link = "GruvboxOrangeSign"; | 48 | cursorline = true; |
94 | GitSignsDelete.link = "GruvboxRedSign"; | 49 | diffopt = [ |
95 | IblScope.link = "GruvboxAqua"; | 50 | "internal" |
51 | "filler" | ||
52 | "closeoff" | ||
53 | "linematch:60" | ||
54 | ]; | ||
55 | grepprg = "${lib.getExe pkgs.ripgrep} --vimgrep --smart-case"; | ||
56 | ignorecase = true; | ||
57 | inccommand = "split"; | ||
58 | list = true; | ||
59 | listchars = { | ||
60 | extends = ">"; | ||
61 | nbsp = "+"; | ||
62 | precedes = "<"; | ||
63 | tab = " "; | ||
64 | trail = "-"; | ||
96 | }; | 65 | }; |
66 | scrolloff = 3; | ||
67 | shiftwidth = 4; | ||
68 | shortmess = "ncAxoTOtfFli"; | ||
69 | showmode = false; | ||
70 | sidescrolloff = 5; | ||
71 | smartcase = true; | ||
72 | smartindent = true; | ||
73 | tabstop = 4; | ||
74 | title = true; | ||
75 | undofile = true; | ||
76 | updatetime = 1000; | ||
77 | wildmode = [ | ||
78 | "longest:full" | ||
79 | "full" | ||
80 | ]; | ||
97 | }; | 81 | }; |
98 | }; | ||
99 | 82 | ||
100 | highlight = { | 83 | colorschemes.gruvbox = { |
101 | TSDefinition.link = "GruvboxBlueSign"; | 84 | enable = true; |
102 | TSDefinitionUsage.link = "GruvboxAquaSign"; | ||
103 | }; | ||
104 | 85 | ||
105 | keymaps = | 86 | settings = { |
106 | let | 87 | # bold = true; |
107 | toggle = key: option: { | 88 | # italics = true; |
108 | mode = "n"; | 89 | # underline = true; |
109 | key = "yo${key}"; | 90 | # undercurl = true; |
110 | action = "<Cmd>setlocal ${option}! ${option}?<CR>"; | 91 | italic.strings = false; |
111 | options.desc = "Toggle ${option}"; | 92 | overrides = { |
112 | }; | 93 | GitSignsAdd.link = "GruvboxGreenSign"; |
113 | in | 94 | GitSignsChange.link = "GruvboxOrangeSign"; |
114 | [ | 95 | GitSignsDelete.link = "GruvboxRedSign"; |
115 | { | 96 | IblScope.link = "GruvboxAqua"; |
116 | key = "-"; | ||
117 | action.__raw = "require('oil').open"; | ||
118 | options.desc = "Open parent directory"; | ||
119 | } | ||
120 | |||
121 | # Git | ||
122 | |||
123 | { | ||
124 | key = "<leader>gg"; | ||
125 | action = "<cmd>Neogit<cr>"; | ||
126 | options.desc = "Open Neogit"; | ||
127 | } | ||
128 | |||
129 | { | ||
130 | key = "<leader>gd"; | ||
131 | action = "<cmd>DiffviewOpen<cr>"; | ||
132 | options.desc = "Open Diffview"; | ||
133 | } | ||
134 | |||
135 | # TODO: noremap? buffer local? silent? | ||
136 | { | ||
137 | key = "<leader>gs"; | ||
138 | action.__raw = "require('gitsigns').stage_hunk"; | ||
139 | options.desc = "Stage hunk"; | ||
140 | } | ||
141 | |||
142 | { | ||
143 | key = "<leader>gr"; | ||
144 | action.__raw = "require('gitsigns').reset_hunk"; | ||
145 | options.desc = "Reset hunk"; | ||
146 | } | ||
147 | |||
148 | # TODO: visual stage/reset | ||
149 | |||
150 | { | ||
151 | key = "<leader>gS"; | ||
152 | action.__raw = "require('gitsigns').stage_buffer"; | ||
153 | options.desc = "Stage buffer"; | ||
154 | } | ||
155 | |||
156 | { | ||
157 | key = "<leader>gR"; | ||
158 | action.__raw = "require('gitsigns').reset_buffer"; | ||
159 | options.desc = "Stage buffer"; | ||
160 | } | ||
161 | |||
162 | { | ||
163 | key = "<leader>gu"; | ||
164 | action.__raw = "require('gitsigns').undo_stage_hunk"; | ||
165 | options.desc = "Undo stage hunk"; | ||
166 | } | ||
167 | |||
168 | { | ||
169 | key = "<leader>gp"; | ||
170 | action.__raw = "require('gitsigns').preview_hunk_inline"; | ||
171 | options.desc = "Preview hunk"; | ||
172 | } | ||
173 | |||
174 | { | ||
175 | key = "<leader>gb"; | ||
176 | action.__raw = "function() require('gitsigns').blame_line { full = true } end"; | ||
177 | options.desc = "Blame line"; | ||
178 | } | ||
179 | |||
180 | { | ||
181 | key = "]g"; | ||
182 | action.__raw = '' | ||
183 | function() | ||
184 | if vim.wo.diff then return ']c' end | ||
185 | vim.schedule(function() package.loaded.gitsigns.next_hunk() end) | ||
186 | return '<Ignore>' | ||
187 | end | ||
188 | ''; | ||
189 | options = { | ||
190 | expr = true; | ||
191 | desc = "Next hunk"; | ||
192 | }; | 97 | }; |
193 | } | 98 | }; |
194 | 99 | }; | |
195 | { | 100 | |
196 | key = "[g"; | 101 | highlight = { |
197 | action.__raw = '' | 102 | TSDefinition.link = "GruvboxBlueSign"; |
198 | function() | 103 | TSDefinitionUsage.link = "GruvboxAquaSign"; |
199 | if vim.wo.diff then return '[c' end | 104 | }; |
200 | vim.schedule(function() package.loaded.gitsigns.prev_hunk() end) | 105 | |
201 | return '<Ignore>' | 106 | keymaps = |
202 | end | 107 | let |
203 | ''; | 108 | toggle = key: option: { |
204 | options = { | 109 | mode = "n"; |
205 | expr = true; | 110 | key = "yo${key}"; |
206 | desc = "Next hunk"; | 111 | action = "<Cmd>setlocal ${option}! ${option}?<CR>"; |
112 | options.desc = "Toggle ${option}"; | ||
207 | }; | 113 | }; |
208 | } | 114 | in |
209 | 115 | [ | |
210 | # Leap | 116 | { |
211 | 117 | key = "-"; | |
212 | { | 118 | action.__raw = "require('oil').open"; |
213 | key = "<Space>"; | 119 | options.desc = "Open parent directory"; |
214 | mode = [ | 120 | } |
215 | "n" | 121 | |
216 | "x" | 122 | # Git |
217 | "o" | 123 | |
218 | ]; | 124 | { |
219 | action = "<Plug>(leap-forward)"; | 125 | key = "<leader>gg"; |
220 | options.desc = "Leap forward to"; | 126 | action = "<cmd>Neogit<cr>"; |
221 | } | 127 | options.desc = "Open Neogit"; |
222 | 128 | } | |
223 | { | 129 | |
224 | key = "<C-Space>"; | 130 | { |
225 | mode = [ | 131 | key = "<leader>gd"; |
226 | "n" | 132 | action = "<cmd>DiffviewOpen<cr>"; |
227 | "x" | 133 | options.desc = "Open Diffview"; |
228 | "o" | 134 | } |
229 | ]; | 135 | |
230 | action = "<Plug>(leap-backward)"; | 136 | # TODO: noremap? buffer local? silent? |
231 | options.desc = "Leap backward to"; | 137 | { |
232 | } | 138 | key = "<leader>gs"; |
233 | 139 | action.__raw = "require('gitsigns').stage_hunk"; | |
234 | { | 140 | options.desc = "Stage hunk"; |
235 | key = "g<Space>"; | 141 | } |
236 | mode = [ | 142 | |
237 | "n" | 143 | { |
238 | "x" | 144 | key = "<leader>gr"; |
239 | "o" | 145 | action.__raw = "require('gitsigns').reset_hunk"; |
240 | ]; | 146 | options.desc = "Reset hunk"; |
241 | action = "<Plug>(leap-from-window)"; | 147 | } |
242 | options.desc = "Leap from window"; | 148 | |
243 | } | 149 | # TODO: visual stage/reset |
244 | 150 | ||
245 | { | 151 | { |
246 | key = "gnn"; | 152 | key = "<leader>gS"; |
247 | mode = [ | 153 | action.__raw = "require('gitsigns').stage_buffer"; |
248 | "n" | 154 | options.desc = "Stage buffer"; |
249 | "x" | 155 | } |
250 | "o" | 156 | |
251 | ]; | 157 | { |
252 | action.__raw = '' | 158 | key = "<leader>gR"; |
253 | function() | 159 | action.__raw = "require('gitsigns').reset_buffer"; |
254 | require('leap.treesitter').select() | 160 | options.desc = "Stage buffer"; |
255 | end | 161 | } |
256 | ''; | 162 | |
257 | options.desc = "Start incremental selection"; | 163 | { |
258 | } | 164 | key = "<leader>gu"; |
259 | 165 | action.__raw = "require('gitsigns').undo_stage_hunk"; | |
260 | { | 166 | options.desc = "Undo stage hunk"; |
261 | key = "gnN"; | 167 | } |
262 | mode = [ | 168 | |
263 | "n" | 169 | { |
264 | "x" | 170 | key = "<leader>gp"; |
265 | "o" | 171 | action.__raw = "require('gitsigns').preview_hunk_inline"; |
266 | ]; | 172 | options.desc = "Preview hunk"; |
267 | action = "V<cmd>lua require('leap.treesitter').select()<cr>"; | 173 | } |
268 | options.desc = "Start linewise incremental selection"; | 174 | |
269 | } | 175 | { |
270 | 176 | key = "<leader>gb"; | |
271 | # Toggle options | 177 | action.__raw = "function() require('gitsigns').blame_line { full = true } end"; |
272 | (toggle "c" "cursorline") | 178 | options.desc = "Blame line"; |
273 | (toggle "C" "cursorcolumn") | 179 | } |
274 | (toggle "h" "hlsearch") | 180 | |
275 | (toggle "i" "ignorecase") | 181 | { |
276 | (toggle "l" "list") | 182 | key = "]g"; |
277 | (toggle "n" "number") | 183 | action.__raw = '' |
278 | (toggle "r" "relativenumber") | 184 | function() |
279 | (toggle "s" "spell") | 185 | if vim.wo.diff then return ']c' end |
280 | (toggle "w" "wrap") | 186 | vim.schedule(function() package.loaded.gitsigns.next_hunk() end) |
281 | 187 | return '<Ignore>' | |
282 | { | ||
283 | mode = "n"; | ||
284 | key = "yod"; | ||
285 | action.__raw = '' | ||
286 | function() | ||
287 | if vim.wo.diff then | ||
288 | vim.cmd.diffoff() | ||
289 | print('diffoff') | ||
290 | else | ||
291 | vim.cmd.diffthis() | ||
292 | print('diffthis') | ||
293 | end | 188 | end |
294 | end | 189 | ''; |
295 | ''; | 190 | options = { |
296 | options.desc = "Toggle diff"; | 191 | expr = true; |
297 | } | 192 | desc = "Next hunk"; |
298 | ]; | 193 | }; |
194 | } | ||
195 | |||
196 | { | ||
197 | key = "[g"; | ||
198 | action.__raw = '' | ||
199 | function() | ||
200 | if vim.wo.diff then return '[c' end | ||
201 | vim.schedule(function() package.loaded.gitsigns.prev_hunk() end) | ||
202 | return '<Ignore>' | ||
203 | end | ||
204 | ''; | ||
205 | options = { | ||
206 | expr = true; | ||
207 | desc = "Next hunk"; | ||
208 | }; | ||
209 | } | ||
299 | 210 | ||
300 | # TODO: | 211 | # Leap |
301 | # extraPlugins = with pkgs.unstable.vimPlugins; [ | ||
302 | extraPlugins = with inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.vimPlugins; [ | ||
303 | highlight-undo-nvim | ||
304 | vim-abolish | ||
305 | 212 | ||
306 | # TODO: make that modular | 213 | { |
307 | playground | 214 | key = "<Space>"; |
215 | mode = [ | ||
216 | "n" | ||
217 | "x" | ||
218 | "o" | ||
219 | ]; | ||
220 | action = "<Plug>(leap-forward)"; | ||
221 | options.desc = "Leap forward to"; | ||
222 | } | ||
223 | |||
224 | { | ||
225 | key = "<C-Space>"; | ||
226 | mode = [ | ||
227 | "n" | ||
228 | "x" | ||
229 | "o" | ||
230 | ]; | ||
231 | action = "<Plug>(leap-backward)"; | ||
232 | options.desc = "Leap backward to"; | ||
233 | } | ||
234 | |||
235 | { | ||
236 | key = "g<Space>"; | ||
237 | mode = [ | ||
238 | "n" | ||
239 | "x" | ||
240 | "o" | ||
241 | ]; | ||
242 | action = "<Plug>(leap-from-window)"; | ||
243 | options.desc = "Leap from window"; | ||
244 | } | ||
245 | |||
246 | { | ||
247 | key = "gnn"; | ||
248 | mode = [ | ||
249 | "n" | ||
250 | "x" | ||
251 | "o" | ||
252 | ]; | ||
253 | action.__raw = '' | ||
254 | function() | ||
255 | require('leap.treesitter').select() | ||
256 | end | ||
257 | ''; | ||
258 | options.desc = "Start incremental selection"; | ||
259 | } | ||
260 | |||
261 | { | ||
262 | key = "gnN"; | ||
263 | mode = [ | ||
264 | "n" | ||
265 | "x" | ||
266 | "o" | ||
267 | ]; | ||
268 | action = "V<cmd>lua require('leap.treesitter').select()<cr>"; | ||
269 | options.desc = "Start linewise incremental selection"; | ||
270 | } | ||
271 | |||
272 | # Toggle options | ||
273 | (toggle "c" "cursorline") | ||
274 | (toggle "C" "cursorcolumn") | ||
275 | (toggle "h" "hlsearch") | ||
276 | (toggle "i" "ignorecase") | ||
277 | (toggle "l" "list") | ||
278 | (toggle "n" "number") | ||
279 | (toggle "r" "relativenumber") | ||
280 | (toggle "s" "spell") | ||
281 | (toggle "w" "wrap") | ||
282 | |||
283 | { | ||
284 | mode = "n"; | ||
285 | key = "yod"; | ||
286 | action.__raw = '' | ||
287 | function() | ||
288 | if vim.wo.diff then | ||
289 | vim.cmd.diffoff() | ||
290 | print('diffoff') | ||
291 | else | ||
292 | vim.cmd.diffthis() | ||
293 | print('diffthis') | ||
294 | end | ||
295 | end | ||
296 | ''; | ||
297 | options.desc = "Toggle diff"; | ||
298 | } | ||
299 | ]; | ||
308 | 300 | ||
309 | vim-rhubarb | 301 | # TODO: |
310 | fugitive-gitlab-vim | 302 | # extraPlugins = with pkgs.unstable.vimPlugins; [ |
303 | extraPlugins = with inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.vimPlugins; [ | ||
304 | highlight-undo-nvim | ||
305 | vim-abolish | ||
311 | 306 | ||
312 | vim-polyglot | 307 | # TODO: make that modular |
308 | playground | ||
313 | 309 | ||
314 | nvim-surround | 310 | vim-rhubarb |
315 | ]; | 311 | fugitive-gitlab-vim |
316 | 312 | ||
317 | plugins = { | 313 | vim-polyglot |
318 | cmp = { | ||
319 | enable = true; | ||
320 | 314 | ||
321 | settings = { | 315 | nvim-surround |
322 | mapping.__raw = '' | 316 | ]; |
323 | cmp.mapping.preset.insert { | ||
324 | ['<CR>'] = cmp.mapping.confirm({ select = false }), | ||
325 | |||
326 | ["<Tab>"] = cmp.mapping(function(fallback) | ||
327 | local luasnip = require("luasnip") | ||
328 | if luasnip.locally_jumpable(1) then | ||
329 | luasnip.jump(1) | ||
330 | else | ||
331 | fallback() | ||
332 | end | ||
333 | end, { "i", "s" }), | ||
334 | 317 | ||
335 | ["<S-Tab>"] = cmp.mapping(function(fallback) | 318 | plugins = { |
336 | local luasnip = require("luasnip") | 319 | cmp = { |
337 | if luasnip.locally_jumpable(-1) then | 320 | enable = true; |
338 | luasnip.jump(-1) | ||
339 | else | ||
340 | fallback() | ||
341 | end | ||
342 | end, { "i", "s" }), | ||
343 | } | ||
344 | ''; | ||
345 | 321 | ||
346 | snippet.expand = '' | 322 | settings = { |
347 | function(args) | 323 | mapping.__raw = '' |
348 | require('luasnip').lsp_expand(args.body) | 324 | cmp.mapping.preset.insert { |
349 | end | 325 | ['<CR>'] = cmp.mapping.confirm({ select = false }), |
350 | ''; | 326 | |
351 | 327 | ["<Tab>"] = cmp.mapping(function(fallback) | |
352 | sources = [ | 328 | local luasnip = require("luasnip") |
353 | { name = "nvim_lsp"; } | 329 | if luasnip.locally_jumpable(1) then |
354 | { name = "nvim_lsp_signature_help"; } | 330 | luasnip.jump(1) |
355 | { name = "cmp_pandoc"; } | 331 | else |
356 | # TODO: make this modular | 332 | fallback() |
357 | { name = "crates"; } | 333 | end |
358 | { name = "luasnip"; } | 334 | end, { "i", "s" }), |
359 | { name = "calc"; } | 335 | |
360 | { name = "path"; } | 336 | ["<S-Tab>"] = cmp.mapping(function(fallback) |
361 | { name = "treesitter"; } | 337 | local luasnip = require("luasnip") |
362 | { name = "git"; } | 338 | if luasnip.locally_jumpable(-1) then |
363 | { name = "tmux"; } | 339 | luasnip.jump(-1) |
364 | { name = "spell"; } | 340 | else |
365 | # Use \k for iskeyword because of UTF-8 | 341 | fallback() |
366 | { | 342 | end |
367 | name = "buffer"; | 343 | end, { "i", "s" }), |
368 | option.keyword_pattern = ''\k\+''; | 344 | } |
369 | } | 345 | ''; |
370 | ]; | 346 | |
347 | snippet.expand = '' | ||
348 | function(args) | ||
349 | require('luasnip').lsp_expand(args.body) | ||
350 | end | ||
351 | ''; | ||
352 | |||
353 | sources = [ | ||
354 | { name = "nvim_lsp"; } | ||
355 | { name = "nvim_lsp_signature_help"; } | ||
356 | { name = "cmp_pandoc"; } | ||
357 | # TODO: make this modular | ||
358 | { name = "crates"; } | ||
359 | { name = "luasnip"; } | ||
360 | { name = "calc"; } | ||
361 | { name = "path"; } | ||
362 | { name = "treesitter"; } | ||
363 | { name = "git"; } | ||
364 | { name = "tmux"; } | ||
365 | { name = "spell"; } | ||
366 | # Use \k for iskeyword because of UTF-8 | ||
367 | { | ||
368 | name = "buffer"; | ||
369 | option.keyword_pattern = ''\k\+''; | ||
370 | } | ||
371 | ]; | ||
372 | }; | ||
371 | }; | 373 | }; |
372 | }; | 374 | # cmp-buffer.enable = true; |
373 | # cmp-buffer.enable = true; | 375 | # cmp-calc.enable = true; |
374 | # cmp-calc.enable = true; | 376 | # cmp-cmdline.enable = true; |
375 | # cmp-cmdline.enable = true; | 377 | # cmp-git.enable = true; |
376 | # cmp-git.enable = true; | ||
377 | 378 | ||
378 | diffview.enable = true; | 379 | diffview.enable = true; |
379 | 380 | ||
380 | dressing.enable = true; | 381 | dressing.enable = true; |
381 | 382 | ||
382 | fidget = { | 383 | fidget = { |
383 | enable = true; | 384 | enable = true; |
384 | notification.overrideVimNotify = true; | 385 | notification.overrideVimNotify = true; |
385 | }; | 386 | }; |
386 | 387 | ||
387 | fugitive.enable = true; | 388 | fugitive.enable = true; |
388 | 389 | ||
389 | gitignore.enable = true; | 390 | gitignore.enable = true; |
390 | 391 | ||
391 | gitsigns.enable = true; | 392 | gitsigns.enable = true; |
392 | 393 | ||
393 | indent-blankline = { | 394 | indent-blankline = { |
394 | enable = true; | 395 | enable = true; |
395 | settings.indent = { | 396 | settings.indent = { |
396 | char = "│"; | 397 | char = "│"; |
397 | tab_char = "│"; | 398 | tab_char = "│"; |
399 | }; | ||
398 | }; | 400 | }; |
399 | }; | ||
400 | 401 | ||
401 | lastplace.enable = true; | 402 | lastplace.enable = true; |
402 | 403 | ||
403 | leap = { | 404 | leap = { |
404 | enable = true; | 405 | enable = true; |
405 | addDefaultMappings = false; | 406 | addDefaultMappings = false; |
406 | }; | 407 | }; |
407 | 408 | ||
408 | lualine = { | 409 | lualine = { |
409 | enable = true; | 410 | enable = true; |
410 | settings.options = { | 411 | settings.options = { |
411 | component_separators.left = ""; | 412 | component_separators.left = ""; |
412 | component_separators.right = ""; | 413 | component_separators.right = ""; |
413 | 414 | ||
414 | section_separators.left = ""; | 415 | section_separators.left = ""; |
415 | section_separators.right = ""; | 416 | section_separators.right = ""; |
416 | 417 | ||
417 | icons_enabled = false; | 418 | icons_enabled = false; |
419 | }; | ||
418 | }; | 420 | }; |
419 | }; | ||
420 | 421 | ||
421 | luasnip.enable = true; | 422 | luasnip.enable = true; |
422 | 423 | ||
423 | mini = { | 424 | mini = { |
424 | enable = true; | 425 | enable = true; |
425 | modules = { | 426 | modules = { |
426 | ai.custom_textobjects = { | 427 | ai.custom_textobjects = { |
427 | search_method = "cover_or_nearest"; | 428 | search_method = "cover_or_nearest"; |
428 | 429 | ||
429 | f.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' })"; | 430 | f.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' })"; |
430 | F.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@call.outer', i = '@call.inner' })"; | 431 | F.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@call.outer', i = '@call.inner' })"; |
431 | c.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@comment.outer', i = '@comment.inner' })"; | 432 | c.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@comment.outer', i = '@comment.inner' })"; |
432 | b.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@block.outer', i = '@block.inner' })"; | 433 | b.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@block.outer', i = '@block.inner' })"; |
433 | a.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@parameter.outer', i = '@parameter.inner' })"; | 434 | a.__raw = "require('mini.ai').gen_spec.treesitter({ a = '@parameter.outer', i = '@parameter.inner' })"; |
434 | o.__raw = '' | 435 | o.__raw = '' |
435 | require('mini.ai').gen_spec.treesitter({ | 436 | require('mini.ai').gen_spec.treesitter({ |
436 | a = { '@conditional.outer', '@loop.outer' }, | 437 | a = { '@conditional.outer', '@loop.outer' }, |
437 | i = { '@conditional.inner', '@loop.inner' }, | 438 | i = { '@conditional.inner', '@loop.inner' }, |
438 | }) | 439 | }) |
439 | ''; | 440 | ''; |
440 | }; | 441 | }; |
441 | align = { }; | 442 | align = { }; |
442 | bracketed = { }; | 443 | bracketed = { }; |
443 | clue = { | 444 | clue = { |
444 | triggers = [ | 445 | triggers = [ |
445 | { | 446 | { |
446 | mode = "n"; | 447 | mode = "n"; |
447 | keys = "yo"; | 448 | keys = "yo"; |
448 | } | 449 | } |
449 | { | 450 | { |
450 | mode = "n"; | 451 | mode = "n"; |
451 | keys = "["; | 452 | keys = "["; |
452 | } | 453 | } |
453 | { | 454 | { |
454 | mode = "n"; | 455 | mode = "n"; |
455 | keys = "]"; | 456 | keys = "]"; |
456 | } | 457 | } |
457 | { | 458 | { |
458 | mode = "n"; | 459 | mode = "n"; |
459 | keys = "<leader>"; | 460 | keys = "<leader>"; |
460 | } | 461 | } |
461 | ]; | 462 | ]; |
463 | }; | ||
464 | trailspace = { }; | ||
462 | }; | 465 | }; |
463 | trailspace = { }; | ||
464 | }; | 466 | }; |
465 | }; | ||
466 | 467 | ||
467 | neogit = { | 468 | neogit = { |
468 | enable = true; | 469 | enable = true; |
469 | settings = { | 470 | settings = { |
470 | graph_style = "unicode"; | 471 | graph_style = "unicode"; |
471 | integrations = { | 472 | integrations = { |
472 | diffview = true; | 473 | diffview = true; |
473 | telescope = true; | 474 | telescope = true; |
475 | }; | ||
474 | }; | 476 | }; |
475 | }; | 477 | }; |
476 | }; | ||
477 | 478 | ||
478 | none-ls = { | 479 | none-ls = { |
479 | enable = true; | 480 | enable = true; |
480 | sources = { | 481 | sources = { |
481 | code_actions = { | 482 | code_actions = { |
482 | gitrebase.enable = true; | 483 | gitrebase.enable = true; |
483 | gitsigns.enable = true; | 484 | gitsigns.enable = true; |
484 | # TODO: maybe? | 485 | # TODO: maybe? |
485 | #refactoring.enable = true; | 486 | #refactoring.enable = true; |
486 | statix.enable = true; | 487 | statix.enable = true; |
487 | }; | 488 | }; |
488 | 489 | ||
489 | diagnostics = { | 490 | diagnostics = { |
490 | deadnix.enable = true; | 491 | deadnix.enable = true; |
491 | statix = { | 492 | statix = { |
492 | enable = true; | 493 | enable = true; |
493 | settings.extra_args = | 494 | settings.extra_args = |
494 | let | 495 | let |
495 | config = (pkgs.formats.toml { }).generate "statix.toml" { | 496 | config = (pkgs.formats.toml { }).generate "statix.toml" { |
496 | disabled = [ "repeated_keys" ]; | 497 | disabled = [ "repeated_keys" ]; |
497 | }; | 498 | }; |
498 | in | 499 | in |
499 | [ | 500 | [ |
500 | "-c" | 501 | "-c" |
501 | "${config}" | 502 | "${config}" |
503 | ]; | ||
504 | }; | ||
505 | vale = { | ||
506 | enable = true; | ||
507 | settings.extra_filetypes = [ | ||
508 | "pandoc" | ||
509 | "rst" | ||
502 | ]; | 510 | ]; |
511 | }; | ||
503 | }; | 512 | }; |
504 | vale = { | ||
505 | enable = true; | ||
506 | settings.extra_filetypes = [ | ||
507 | "pandoc" | ||
508 | "rst" | ||
509 | ]; | ||
510 | }; | ||
511 | }; | ||
512 | 513 | ||
513 | formatting = { | 514 | formatting = { |
514 | shfmt.enable = true; | 515 | shfmt.enable = true; |
515 | typstyle.enable = true; | 516 | typstyle.enable = true; |
517 | }; | ||
516 | }; | 518 | }; |
517 | }; | 519 | }; |
518 | }; | ||
519 | 520 | ||
520 | nvim-osc52 = { | 521 | # TODO: neovim 0.10: replace |
521 | enable = true; | 522 | nvim-osc52 = { |
522 | keymaps.enable = true; | 523 | enable = true; |
523 | }; | 524 | keymaps.enable = true; |
525 | }; | ||
524 | 526 | ||
525 | oil.enable = true; | 527 | oil.enable = true; |
526 | 528 | ||
527 | # TODO: maybe | 529 | # TODO: maybe |
528 | #refactoring.enable = true; | 530 | #refactoring.enable = true; |
529 | 531 | ||
530 | spider = { | 532 | spider = { |
531 | enable = true; | 533 | enable = true; |
532 | keymaps.motions = { | 534 | keymaps.motions = { |
533 | b = "<localleader>b"; | 535 | b = "<localleader>b"; |
534 | e = "<localleader>e"; | 536 | e = "<localleader>e"; |
535 | ge = "<localleader>ge"; | 537 | ge = "<localleader>ge"; |
536 | w = "<localleader>w"; | 538 | w = "<localleader>w"; |
539 | }; | ||
537 | }; | 540 | }; |
538 | }; | ||
539 | 541 | ||
540 | telescope = { | 542 | telescope = { |
541 | enable = true; | 543 | enable = true; |
542 | settings = { }; | 544 | settings = { }; |
543 | 545 | ||
544 | extensions.undo.enable = true; | 546 | extensions.undo.enable = true; |
545 | 547 | ||
546 | keymaps = { | 548 | keymaps = { |
547 | "<leader>fb" = { | 549 | "<leader>fb" = { |
548 | action = "buffers"; | 550 | action = "buffers"; |
549 | options.desc = "Telescope buffers"; | 551 | options.desc = "Telescope buffers"; |
550 | }; | 552 | }; |
551 | 553 | ||
552 | "<leader>ff" = { | 554 | "<leader>ff" = { |
553 | action = "find_files"; | 555 | action = "find_files"; |
554 | options.desc = "Telescope find files"; | 556 | options.desc = "Telescope find files"; |
555 | }; | 557 | }; |
556 | 558 | ||
557 | "<leader>fg" = { | 559 | "<leader>fg" = { |
558 | action = "live_grep"; | 560 | action = "live_grep"; |
559 | options.desc = "Telescope live grep"; | 561 | options.desc = "Telescope live grep"; |
560 | }; | 562 | }; |
561 | 563 | ||
562 | "<leader>fh" = { | 564 | "<leader>fh" = { |
563 | action = "help_tags"; | 565 | action = "help_tags"; |
564 | options.desc = "Telescope help tags"; | 566 | options.desc = "Telescope help tags"; |
565 | }; | 567 | }; |
566 | 568 | ||
567 | "<leader>fo" = { | 569 | "<leader>fo" = { |
568 | action = "oldfiles"; | 570 | action = "oldfiles"; |
569 | options.desc = "Telescope old files"; | 571 | options.desc = "Telescope old files"; |
570 | }; | 572 | }; |
571 | 573 | ||
572 | "<leader>fs" = { | 574 | "<leader>fs" = { |
573 | action = "spell_suggest"; | 575 | action = "spell_suggest"; |
574 | options.desc = "Telescope spell suggest"; | 576 | options.desc = "Telescope spell suggest"; |
575 | }; | 577 | }; |
576 | 578 | ||
577 | "<leader>ft" = { | 579 | "<leader>ft" = { |
578 | action = "treesitter"; | 580 | action = "treesitter"; |
579 | options.desc = "Telescope treesitter"; | 581 | options.desc = "Telescope treesitter"; |
580 | }; | 582 | }; |
581 | 583 | ||
582 | "<leader>fu" = { | 584 | "<leader>fu" = { |
583 | action = "undo"; | 585 | action = "undo"; |
584 | options.desc = "Telescope undo"; | 586 | options.desc = "Telescope undo"; |
585 | }; | 587 | }; |
586 | 588 | ||
587 | "<leader>fw" = { | 589 | "<leader>fw" = { |
588 | action = "git_status"; | 590 | action = "git_status"; |
589 | options.desc = "Telescope git status"; | 591 | options.desc = "Telescope git status"; |
592 | }; | ||
590 | }; | 593 | }; |
591 | }; | 594 | }; |
592 | }; | ||
593 | 595 | ||
594 | treesitter = { | 596 | treesitter = { |
595 | enable = true; | 597 | enable = true; |
596 | nixvimInjections = true; | 598 | nixvimInjections = true; |
597 | 599 | ||
598 | settings = { | 600 | settings = { |
599 | highlight.enable = true; | 601 | highlight.enable = true; |
600 | indent.enable = true; | 602 | indent.enable = true; |
603 | }; | ||
601 | }; | 604 | }; |
602 | }; | ||
603 | 605 | ||
604 | treesitter-context = { | 606 | treesitter-context = { |
605 | enable = true; | 607 | enable = true; |
606 | settings = { | 608 | settings = { |
607 | max_lines = 5; | 609 | max_lines = 5; |
608 | min_window_height = 20; | 610 | min_window_height = 20; |
611 | }; | ||
609 | }; | 612 | }; |
610 | }; | ||
611 | 613 | ||
612 | treesitter-refactor = { | 614 | treesitter-refactor = { |
613 | enable = true; | 615 | enable = true; |
614 | highlightDefinitions.enable = true; | 616 | highlightDefinitions.enable = true; |
615 | }; | 617 | }; |
616 | 618 | ||
617 | treesitter-textobjects = { | 619 | treesitter-textobjects = { |
618 | enable = true; | ||
619 | lspInterop = { | ||
620 | enable = true; | 620 | enable = true; |
621 | peekDefinitionCode = { | 621 | lspInterop = { |
622 | "<leader>df" = { | 622 | enable = true; |
623 | query = "@function.outer"; | 623 | peekDefinitionCode = { |
624 | desc = "Peek outer function"; | 624 | "<leader>df" = { |
625 | }; | 625 | query = "@function.outer"; |
626 | "<leader>dF" = { | 626 | desc = "Peek outer function"; |
627 | query = "@class.outer"; | 627 | }; |
628 | desc = "Peek outer class"; | 628 | "<leader>dF" = { |
629 | query = "@class.outer"; | ||
630 | desc = "Peek outer class"; | ||
631 | }; | ||
629 | }; | 632 | }; |
630 | }; | 633 | }; |
631 | }; | 634 | }; |
632 | }; | ||
633 | 635 | ||
634 | vim-matchup = { | 636 | vim-matchup = { |
635 | enable = true; | 637 | enable = true; |
636 | treesitterIntegration.enable = true; | 638 | treesitterIntegration.enable = true; |
639 | }; | ||
640 | |||
641 | web-devicons.enable = true; | ||
637 | }; | 642 | }; |
638 | 643 | ||
639 | web-devicons.enable = true; | 644 | extraConfigLua = '' |
645 | vim.api.nvim_create_autocmd("TextYankPost", { | ||
646 | desc = "Highlight yanked text", | ||
647 | callback = function() | ||
648 | vim.highlight.on_yank() | ||
649 | end, | ||
650 | }) | ||
651 | |||
652 | require('highlight-undo').setup({ | ||
653 | keymaps = { | ||
654 | -- Right now messes up registers | ||
655 | paste = { disabled = true, }, | ||
656 | Paste = { disabled = true, }, | ||
657 | }, | ||
658 | }) | ||
659 | |||
660 | -- For fugitive's :GBrowse | ||
661 | vim.api.nvim_create_user_command("Browse", function(opts) | ||
662 | vim.ui.open(opts.args) | ||
663 | end, { nargs = 1 }) | ||
664 | |||
665 | require("nvim-surround").setup() | ||
666 | ''; | ||
667 | |||
668 | extraConfigLuaPost = '' | ||
669 | -- Load local config | ||
670 | |||
671 | local function isModuleAvailable(name) | ||
672 | if package.loaded[name] then | ||
673 | return true | ||
674 | else | ||
675 | for _, searcher in ipairs(package.searchers or package.loaders) do | ||
676 | local loader = searcher(name) | ||
677 | if type(loader) == "function" then | ||
678 | package.preload[name] = loader | ||
679 | return true | ||
680 | end | ||
681 | end | ||
682 | return false | ||
683 | end | ||
684 | end | ||
685 | |||
686 | vim.opt.runtimepath:append(vim.fn.stdpath("config")) -- ~/.config/nvim | ||
687 | |||
688 | if isModuleAvailable "local_config" then | ||
689 | require "local_config" | ||
690 | end | ||
691 | ''; | ||
640 | }; | 692 | }; |
641 | 693 | ||
642 | extraConfigLua = '' | 694 | environment.systemPackages = [ config.programs.nixvim.finalPackage ]; |
643 | vim.api.nvim_create_autocmd("TextYankPost", { | ||
644 | desc = "Highlight yanked text", | ||
645 | callback = function() | ||
646 | vim.highlight.on_yank() | ||
647 | end, | ||
648 | }) | ||
649 | |||
650 | require('highlight-undo').setup({ | ||
651 | keymaps = { | ||
652 | -- Right now messes up registers | ||
653 | paste = { disabled = true, }, | ||
654 | Paste = { disabled = true, }, | ||
655 | }, | ||
656 | }) | ||
657 | |||
658 | -- For fugitive's :GBrowse | ||
659 | vim.api.nvim_create_user_command("Browse", function(opts) | ||
660 | vim.ui.open(opts.args) | ||
661 | end, { nargs = 1 }) | ||
662 | |||
663 | require("nvim-surround").setup() | ||
664 | ''; | ||
665 | |||
666 | extraConfigLuaPost = '' | ||
667 | -- Load local config | ||
668 | |||
669 | local function isModuleAvailable(name) | ||
670 | if package.loaded[name] then | ||
671 | return true | ||
672 | else | ||
673 | for _, searcher in ipairs(package.searchers or package.loaders) do | ||
674 | local loader = searcher(name) | ||
675 | if type(loader) == "function" then | ||
676 | package.preload[name] = loader | ||
677 | return true | ||
678 | end | ||
679 | end | ||
680 | return false | ||
681 | end | ||
682 | end | ||
683 | 695 | ||
684 | vim.opt.runtimepath:append(vim.fn.stdpath("config")) -- ~/.config/nvim | 696 | environment.variables = { |
697 | EDITOR = "nvim"; | ||
698 | MANPAGER = "nvim +Man!"; | ||
699 | }; | ||
685 | 700 | ||
686 | if isModuleAvailable "local_config" then | 701 | home-manager.users.minijackson.xdg.dataFile."nvim/backup/.keep".text = ""; |
687 | require "local_config" | 702 | home-manager.users.root.xdg.dataFile."nvim/backup/.keep".text = ""; |
688 | end | ||
689 | ''; | ||
690 | }; | 703 | }; |
691 | |||
692 | config.environment.systemPackages = [ config.programs.nixvim.finalPackage ]; | ||
693 | } | 704 | } |
diff --git a/common/vim.nix b/common/vim.nix deleted file mode 100644 index 10a8705..0000000 --- a/common/vim.nix +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | inputs: { | ||
2 | config, | ||
3 | pkgs, | ||
4 | lib, | ||
5 | ... | ||
6 | }: let | ||
7 | inherit (pkgs.unstable) neovim-unwrapped vimPlugins wrapNeovim; | ||
8 | |||
9 | luaFormat = inputs.self.lib.generators.lua {}; | ||
10 | |||
11 | cfg = config.vim; | ||
12 | |||
13 | variables = with lib; | ||
14 | pkgs.writeTextDir "lua/myVariables.lua" '' | ||
15 | -- Autogenerated variables from the NixOS configuration | ||
16 | |||
17 | ${(concatStringsSep | ||
18 | "\n" | ||
19 | (mapAttrsToList | ||
20 | (variable: value: "vim.g.${variable} = ${luaFormat.generate value}") | ||
21 | cfg.variables))} | ||
22 | ''; | ||
23 | |||
24 | extraConfig = pkgs.writeTextDir "lua/myExtraConfig.lua" '' | ||
25 | -- luaConfig from the NixOS configuration | ||
26 | |||
27 | ${cfg.luaConfig} | ||
28 | ''; | ||
29 | |||
30 | myGeneratedConfigPackage = pkgs.symlinkJoin { | ||
31 | name = "myGeneratedConfig-nvim"; | ||
32 | paths = [variables extraConfig]; | ||
33 | }; | ||
34 | |||
35 | myConfigPackage = pkgs.unstable.vimUtils.buildVimPlugin { | ||
36 | name = "myConfig-nvim"; | ||
37 | src = ../dotfiles/vim; | ||
38 | }; | ||
39 | |||
40 | myNeovim = wrapNeovim neovim-unwrapped { | ||
41 | configure = { | ||
42 | inherit (config.vim) beforePlugins; | ||
43 | |||
44 | customRC = '' | ||
45 | lua require("myVariables") | ||
46 | lua require("myConfig") | ||
47 | lua require("myExtraConfig") | ||
48 | |||
49 | ${cfg.extraConfig} | ||
50 | ''; | ||
51 | |||
52 | packages.myVimPackage = with vimPlugins; { | ||
53 | start = | ||
54 | [ | ||
55 | myGeneratedConfigPackage | ||
56 | myConfigPackage | ||
57 | |||
58 | # Dependencies | ||
59 | plenary-nvim | ||
60 | popup-nvim | ||
61 | |||
62 | # UI | ||
63 | undotree | ||
64 | gruvbox-community | ||
65 | lualine-nvim | ||
66 | gitsigns-nvim | ||
67 | diffview-nvim | ||
68 | fidget-nvim | ||
69 | indent-blankline-nvim | ||
70 | oil-nvim | ||
71 | dressing-nvim | ||
72 | highlight-undo-nvim | ||
73 | |||
74 | # Completion | ||
75 | nvim-cmp | ||
76 | cmp-buffer | ||
77 | cmp-calc | ||
78 | cmp-cmdline | ||
79 | cmp-latex-symbols | ||
80 | cmp-nvim-lsp | ||
81 | cmp-path | ||
82 | cmp-spell | ||
83 | cmp-tmux | ||
84 | cmp-treesitter | ||
85 | cmp-vsnip | ||
86 | |||
87 | # Snippets | ||
88 | vim-vsnip | ||
89 | vim-vsnip-integ | ||
90 | |||
91 | # Telescope | ||
92 | telescope-nvim | ||
93 | telescope-undo-nvim | ||
94 | |||
95 | # Treesitter | ||
96 | nvim-treesitter.withAllGrammars | ||
97 | nvim-treesitter-textobjects | ||
98 | nvim-treesitter-context | ||
99 | nvim-treesitter-refactor | ||
100 | |||
101 | vim-matchup | ||
102 | |||
103 | # Motions | ||
104 | camelcasemotion | ||
105 | vim-surround | ||
106 | targets-vim | ||
107 | |||
108 | neoformat | ||
109 | |||
110 | # Languages | ||
111 | vim-polyglot | ||
112 | refactoring-nvim | ||
113 | |||
114 | # Other | ||
115 | comment-nvim | ||
116 | fugitive-gitlab-vim | ||
117 | none-ls-nvim | ||
118 | tabular | ||
119 | tmux-complete-vim | ||
120 | vim-abolish | ||
121 | vim-fugitive | ||
122 | vim-oscyank | ||
123 | vim-repeat | ||
124 | vim-rhubarb | ||
125 | vim-unimpaired | ||
126 | ] | ||
127 | ++ config.vim.extraPlugins; | ||
128 | }; | ||
129 | }; | ||
130 | }; | ||
131 | in { | ||
132 | options.vim = with lib; { | ||
133 | variables = mkOption { | ||
134 | type = types.attrsOf luaFormat.type; | ||
135 | default = {}; | ||
136 | description = "Extra global variables to add at the beginning of the vim configuration."; | ||
137 | }; | ||
138 | |||
139 | extraPlugins = mkOption { | ||
140 | type = with types; listOf package; | ||
141 | default = []; | ||
142 | description = "Names of extra plugins to add"; | ||
143 | }; | ||
144 | |||
145 | beforePlugins = mkOption { | ||
146 | type = types.lines; | ||
147 | default = ""; | ||
148 | description = "Extra lines to add in the vim configuration before loading plugins"; | ||
149 | }; | ||
150 | |||
151 | extraConfig = mkOption { | ||
152 | type = types.lines; | ||
153 | default = ""; | ||
154 | description = "Extra lines to add at the end of the vim configuration"; | ||
155 | }; | ||
156 | |||
157 | luaConfig = mkOption { | ||
158 | type = types.lines; | ||
159 | default = ""; | ||
160 | description = "Lua Neovim configuration"; | ||
161 | }; | ||
162 | |||
163 | wrappedPackage = mkOption { | ||
164 | type = types.package; | ||
165 | description = "Resulting wrapped Neovim package"; | ||
166 | readOnly = true; | ||
167 | }; | ||
168 | }; | ||
169 | |||
170 | config = { | ||
171 | vim = { | ||
172 | wrappedPackage = myNeovim; | ||
173 | variables = { | ||
174 | dominant_color = "${config.theme.colors.dominant}"; | ||
175 | ripgrep_path = "${pkgs.ripgrep}/bin/rg"; | ||
176 | fd_path = "${pkgs.fd}/bin/fd"; | ||
177 | }; | ||
178 | }; | ||
179 | |||
180 | # environment.systemPackages = [myNeovim]; | ||
181 | |||
182 | environment.variables = { | ||
183 | EDITOR = "nvim"; | ||
184 | MANPAGER = "nvim +Man!"; | ||
185 | }; | ||
186 | |||
187 | home-manager.users.minijackson.xdg.dataFile."nvim/backup/.keep".text = ""; | ||
188 | home-manager.users.root.xdg.dataFile."nvim/backup/.keep".text = ""; | ||
189 | }; | ||
190 | } | ||