|
| 1 | +{ curl, neovimPlugins, ... }: |
| 2 | + |
| 3 | +# https://github.com/NixOS/nixpkgs/blob/d86ae899d2909c0899e4d3b29d90d5309771e77c/pkgs/applications/editors/vim/plugins/overrides.nix#L139 |
| 4 | +let |
| 5 | + withDeps = cond: deps: if cond then deps else [ ]; |
| 6 | + |
| 7 | + cmpSkip = [ |
| 8 | + "cmp.matcher_spec" |
| 9 | + "cmp.source_spec" |
| 10 | + "cmp.types.lsp_spec" |
| 11 | + "cmp.context_spec" |
| 12 | + "cmp.core_spec" |
| 13 | + "cmp.utils.feedkeys_spec" |
| 14 | + "cmp.utils.async_spec" |
| 15 | + "cmp.utils.misc_spec" |
| 16 | + "cmp.utils.api_spec" |
| 17 | + "cmp.utils.binary_spec" |
| 18 | + "cmp.utils.keymap_spec" |
| 19 | + "cmp.utils.str_spec" |
| 20 | + "cmp.entry_spec" |
| 21 | + ]; |
| 22 | + |
| 23 | + snackSkip = [ |
| 24 | + # Requires setup call first |
| 25 | + "snacks.dashboard" |
| 26 | + "snacks.debug" |
| 27 | + "snacks.dim" |
| 28 | + "snacks.git" |
| 29 | + "snacks.indent" |
| 30 | + "snacks.input" |
| 31 | + "snacks.lazygit" |
| 32 | + "snacks.notifier" |
| 33 | + "snacks.scratch" |
| 34 | + "snacks.scroll" |
| 35 | + "snacks.terminal" |
| 36 | + "snacks.win" |
| 37 | + "snacks.words" |
| 38 | + "snacks.zen" |
| 39 | + # Optional trouble integration |
| 40 | + "trouble.sources.profiler" |
| 41 | + ]; |
| 42 | +in |
| 43 | +{ p }: { |
| 44 | + checkInputs = |
| 45 | + (withDeps (p == "modes-nvim") [ neovimPlugins.nvim-cmp ]) ++ |
| 46 | + (withDeps (p == "cmp-path") [ neovimPlugins.nvim-cmp ]) ++ |
| 47 | + (withDeps (p == "cmp-vsnip") [ neovimPlugins.nvim-cmp ]); |
| 48 | + |
| 49 | + dependencies = |
| 50 | + (withDeps (p == "diffview") [ neovimPlugins.plenary-nvim ]) ++ |
| 51 | + (withDeps (p == "harpoon") [ neovimPlugins.plenary-nvim ]) ++ |
| 52 | + (withDeps (p == "neogit") [ neovimPlugins.plenary-nvim ]) ++ |
| 53 | + (withDeps (p == "noice") [ neovimPlugins.nui-nvim ]) ++ |
| 54 | + (withDeps (p == "nvim-metals") [ neovimPlugins.plenary-nvim ]) ++ |
| 55 | + (withDeps (p == "nvim-treesitter-textobjects") [ neovimPlugins.nvim-treesitter ]) ++ |
| 56 | + (withDeps (p == "nvim-ufo") [ neovimPlugins.promise-async ]) ++ |
| 57 | + (withDeps (p == "telescope") [ neovimPlugins.plenary-nvim ]) ++ |
| 58 | + (withDeps (p == "todo-comments") [ neovimPlugins.plenary-nvim ]); |
| 59 | + |
| 60 | + nvimRequireCheck = |
| 61 | + (withDeps (p == "diffview") [ "diffview" ]) ++ |
| 62 | + (withDeps (p == "harpoon") [ "harpoon" ]) ++ |
| 63 | + (withDeps (p == "neogit") [ "neogit" ]) ++ |
| 64 | + (withDeps (p == "noice") [ "noice" ]) ++ |
| 65 | + (withDeps (p == "nvim-metals") [ "metals" ]) ++ |
| 66 | + (withDeps (p == "nvim-treesitter") [ "nvim-treesitter" ]) ++ |
| 67 | + (withDeps (p == "nvim-ufo") [ "ufo" ]) ++ |
| 68 | + (withDeps (p == "plenary-nvim") [ "plenary" ]) ++ |
| 69 | + (withDeps (p == "todo-comments") [ "todo-comments" ]); |
| 70 | + |
| 71 | + nvimSkipModule = |
| 72 | + (withDeps (p == "indent-blankline") [ "ibl.config.types" ]) ++ |
| 73 | + (withDeps (p == "nvim-autopairs") [ "nvim-autopairs.completion.cmp" "nvim-autopairs.completion.compe" ]) ++ |
| 74 | + (withDeps (p == "nvim-bufferline") [ "bufferline.commands" ]) ++ |
| 75 | + (withDeps (p == "nvim-cmp") cmpSkip) ++ |
| 76 | + (withDeps (p == "nvim-neoclip") [ "neoclip.fzf" "neoclip.telescope" ]) ++ |
| 77 | + (withDeps (p == "nvim-notify") [ "notify.integrations.fzf" ]) ++ |
| 78 | + (withDeps (p == "nvim-treesitter-context") [ "install_parsers" ]) ++ |
| 79 | + (withDeps (p == "nvim-surround") [ "nvim-surround.queries" ]) ++ |
| 80 | + (withDeps (p == "onedark") [ "barbecue.theme.onedark" "onedark.highlights" "onedark.colors" "onedark.terminal" ]) ++ |
| 81 | + (withDeps (p == "snacks") snackSkip) ++ |
| 82 | + (withDeps (p == "telescope-tabs") [ "search" "search.settings" "search.util" ]) ++ |
| 83 | + (withDeps (p == "tide") [ "tide.render" "tide.api" "tide.panel" "tide" ]) ++ |
| 84 | + (withDeps (p == "tokyonight") [ "tokyonight.docs" "tokyonight.extra.fzf" ]) ++ |
| 85 | + (withDeps (p == "trouble") [ "trouble.docs" ]) ++ |
| 86 | + (withDeps (p == "which-key") [ "which-key.docs" ]); |
| 87 | +} |
0 commit comments