From cb7f84e2b727e922ecda2829512b8033f2d55ff2 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 26 Jun 2023 00:06:33 +0000 Subject: [PATCH] neovim: order plugins lexicographically --- hosts/common/programs/neovim.nix | 54 +++++++++++++++++--------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/hosts/common/programs/neovim.nix b/hosts/common/programs/neovim.nix index 2743a56e9..3b245d5b6 100644 --- a/hosts/common/programs/neovim.nix +++ b/hosts/common/programs/neovim.nix @@ -5,30 +5,11 @@ let inherit (lib) concatMapStrings mkIf optionalString; # this structure roughly mirrors home-manager's `programs.neovim.plugins` option plugins = with pkgs.vimPlugins; [ - # docs: surround-nvim: https://github.com/ur4ltz/surround.nvim/ - # docs: vim-surround: https://github.com/tpope/vim-surround - { plugin = vim-surround; } - # docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim - { plugin = fzf-vim; } - ({ - # docs: tex-conceal-vim: https://github.com/KeitaNakamura/tex-conceal.vim/ - plugin = tex-conceal-vim; - type = "viml"; - config = '' - " present prettier fractions - let g:tex_conceal_frac=1 - ''; - }) - ({ - plugin = vim-SyntaxRange; - type = "viml"; - config = '' - " enable markdown-style codeblock highlighting for tex code - autocmd BufEnter * call SyntaxRange#Include('```tex', '```', 'tex', 'NonText') - " autocmd Syntax tex set conceallevel=2 - ''; - }) - ({ + { + # docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim + plugin = fzf-vim; + } + { # treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters # docs: https://github.com/nvim-treesitter/nvim-treesitter # config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix @@ -64,7 +45,30 @@ let vim.o.foldmethod = 'expr' vim.o.foldexpr = 'nvim_treesitter#foldexpr()' ''; - }) + } + { + # docs: tex-conceal-vim: https://github.com/KeitaNakamura/tex-conceal.vim/ + plugin = tex-conceal-vim; + type = "viml"; + config = '' + " present prettier fractions + let g:tex_conceal_frac=1 + ''; + } + { + # docs: surround-nvim: https://github.com/ur4ltz/surround.nvim/ + # docs: vim-surround: https://github.com/tpope/vim-surround + plugin = vim-surround; + } + { + plugin = vim-SyntaxRange; + type = "viml"; + config = '' + " enable markdown-style codeblock highlighting for tex code + autocmd BufEnter * call SyntaxRange#Include('```tex', '```', 'tex', 'NonText') + " autocmd Syntax tex set conceallevel=2 + ''; + } ]; plugin-packages = map (p: p.plugin) plugins; plugin-config-tex = concatMapStrings (p: optionalString (p.type or "" == "viml") p.config) plugins;