From 81d7eec8c6fd6f27954df7bafbfd7262f2dc4377 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 14 Nov 2023 14:11:03 +0000 Subject: [PATCH] home-manager/neovim: reorganize plugins --- home-manager/editor/neovim.nix | 100 ++++++++++++++++----------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/home-manager/editor/neovim.nix b/home-manager/editor/neovim.nix index edc59a0d..38934f2e 100644 --- a/home-manager/editor/neovim.nix +++ b/home-manager/editor/neovim.nix @@ -136,6 +136,56 @@ in let g:maplocalleader = ',' ''; } + { + plugin = undotree; + config = /* vimscript */ '' + if !isdirectory($HOME . "/.config/nvim/undotree") + call mkdir($HOME . "/.config/nvim/undotree", "p", 0755) + endif + + set undofile + set undodir=~/.config/nvim/undotree + let undotree_WindowLayout = 3 + lua << EOF + vim.keymap.set('n', 'u', ':UndotreeToggle', { desc = "Undotree toggle" }) + EOF + ''; + } + { + plugin = vim-polyglot; + config = /* vimscript */ '' + " use a simpler and faster regex to parse CSV + " does not work with CSVs where the delimiter is quoted inside the field + " let g:csv_strict_columns = 1 + " disabled CSV concealing (e.g.: `,` -> `|`), also faster + let g:csv_no_conceal = 1 + ''; + } + { + plugin = vim-sneak; + config = /* vimscript */ '' + let g:sneak#label = 1 + map f Sneak_f + map F Sneak_F + map t Sneak_t + map T Sneak_T + ''; + } + { + plugin = vim-test; + config = /* vimscript */ '' + let g:test#strategy = "neovim" + let g:test#neovim#start_normal = 1 + let g:test#neovim#term_position = "vert botright" + lua << EOF + vim.keymap.set('n', 'tt', ':TestNearest', { desc = "Test nearest" }) + vim.keymap.set('n', 'tT', ':TestFile', { desc = "Test file" }) + vim.keymap.set('n', 'ts', ':TestSuite', { desc = "Test suite" }) + vim.keymap.set('n', 'tl', ':TestLast', { desc = "Test last" }) + vim.keymap.set('n', 'tv', ':TestVisit', { desc = "Test visit" }) + EOF + ''; + } { plugin = pkgs.writeText "01-init-pre-lua" ""; type = "lua"; @@ -297,41 +347,6 @@ in require('remember').setup {} ''; } - { - plugin = undotree; - config = /* vimscript */ '' - if !isdirectory($HOME . "/.config/nvim/undotree") - call mkdir($HOME . "/.config/nvim/undotree", "p", 0755) - endif - - set undofile - set undodir=~/.config/nvim/undotree - let undotree_WindowLayout = 3 - lua << EOF - vim.keymap.set('n', 'u', ':UndotreeToggle', { desc = "Undotree toggle" }) - EOF - ''; - } - { - plugin = vim-polyglot; - config = /* vimscript */ '' - " use a simpler and faster regex to parse CSV - " does not work with CSVs where the delimiter is quoted inside the field - " let g:csv_strict_columns = 1 - " disabled CSV concealing (e.g.: `,` -> `|`), also faster - let g:csv_no_conceal = 1 - ''; - } - { - plugin = vim-sneak; - config = /* vimscript */ '' - let g:sneak#label = 1 - map f Sneak_f - map F Sneak_F - map t Sneak_t - map T Sneak_T - ''; - } { plugin = telescope-nvim; type = "lua"; @@ -414,21 +429,6 @@ in ) ''; } - { - plugin = vim-test; - config = /* vimscript */ '' - let g:test#strategy = "neovim" - let g:test#neovim#start_normal = 1 - let g:test#neovim#term_position = "vert botright" - lua << EOF - vim.keymap.set('n', 'tt', ':TestNearest', { desc = "Test nearest" }) - vim.keymap.set('n', 'tT', ':TestFile', { desc = "Test file" }) - vim.keymap.set('n', 'ts', ':TestSuite', { desc = "Test suite" }) - vim.keymap.set('n', 'tl', ':TestLast', { desc = "Test last" }) - vim.keymap.set('n', 'tv', ':TestVisit', { desc = "Test visit" }) - EOF - ''; - } mkdir-nvim telescope-fzf-native-nvim vim-advanced-sorters