this repo has no description

perf: clean runtime path

authored by robinwobin.dev and committed by

GitHub 817ac0c7 33674274

+36 -3
+36 -3
wrapper.nix
··· 57 57 # our config 58 58 userConfig, 59 59 60 + # PERF: clean runtime path so it only contains explicit runtime directories 61 + # - removes directories from homedir as well as nix data directories 62 + # - this means some programs that ship extra nvim data files need to be 63 + # explicitly added to the rtp with a package override 64 + cleanRuntimePath ? false, 65 + additionalRuntimePaths ? [ ], 66 + 60 67 # other customisation 61 68 aliases ? [ ], 62 69 keepDesktopFiles ? false, ··· 115 122 package.cpath = "${luaLib.genLuaCPathAbsStr luaEnv};$LUA_CPATH" .. package.cpath 116 123 vim.env.PATH = vim.env.PATH .. ":${makeBinPath extraPackages}" 117 124 vim.g.snippets_path = "$out/pack/${pname}/start/init-plugin/snippets" 118 - vim.opt.packpath:prepend('$out') 119 - vim.opt.runtimepath:prepend('$out') 120 - 125 + '' 126 + + ( 127 + if cleanRuntimePath then 128 + ( 129 + let 130 + # if the runtime path is cleaned, it will be faster to leave the nvim 131 + # base paths at the start since most startup dependencies will be 132 + # found there. 133 + # $out will be put *before* the additionalRuntimePaths to replicate the behavior of `:prepend('$out')`. 134 + runtimePaths = [ 135 + "${basePackage}/lib/nvim" 136 + "${basePackage}/share/nvim/runtime" 137 + "$out" 138 + ] 139 + ++ additionalRuntimePaths; 140 + rtp = builtins.concatStringsSep "," runtimePaths; 141 + in 142 + '' 143 + vim.o.runtimepath = "${rtp}" 144 + vim.o.packpath = "${rtp}" 145 + '' 146 + ) 147 + else 148 + '' 149 + vim.opt.runtimepath:prepend('$out') 150 + vim.opt.packpath:prepend('$out') 151 + '' 152 + ) 153 + + '' 121 154 vim.loader.enable() 122 155 123 156 ${lib.concatMapAttrsStringSep "\n" (provider: enabled: ''