this repo has no description

Merge pull request #3 from tgirlcloud/providers

authored by isabelroses.com and committed by

GitHub c6b440e2 f583c242

+45 -5
+19
README.md
··· 71 71 inotify-tools 72 72 lazygit 73 73 ]; 74 + 75 + # below is a list of plugin providers, these should then be 76 + # configured in your plugin or setup properly by adding to your path 77 + # or the extraInitLua 78 + # 79 + # this can also be a list of strings 80 + providers = { 81 + node = false; 82 + python = false; 83 + python3 = true; 84 + ruby = false; 85 + perl = false; 86 + }; 87 + 88 + # following the providers above, you can set the exact package for 89 + # your providers, in this case python3 90 + extraInitLua = '' 91 + vim.g.python3_host_prog = '${lib.getExe pkgs.python3}' 92 + ''; 74 93 }; 75 94 }); 76 95 };
+26 -5
wrapper.nix
··· 40 40 # path, see there explanation below 41 41 extraPackages ? [ ], 42 42 43 + # providers, these are the providers that will be enabled 44 + providers ? { }, 45 + 46 + # extra init.lua, this is useful for setting up the environment 47 + extraInitLua ? "", 48 + 43 49 # plugins 44 50 startPlugins ? [ ], 45 51 optPlugins ? [ ], ··· 66 72 startWithDeps = findDependenciesRecursively startPlugins; 67 73 startPlugins' = unique (startWithDeps ++ depsOfOptionalPlugins); 68 74 75 + # i couldn't chose a nice api between attrs and lists, so i just did both lol 76 + attrsifiedProviders = 77 + if lib.isAttrs providers then providers else (lib.genAttrs providers (_: true)); 78 + 79 + # merge providers attrs, with priority to the user providerd options 80 + pluginProviders = { 81 + node = false; 82 + perl = false; 83 + python = false; 84 + python3 = false; 85 + ruby = false; 86 + } 87 + // attrsifiedProviders; 88 + 69 89 mkResultingPath = 70 90 subdir: p: 71 91 "pack/${pname}/${subdir}/${if typeOf p == "path" then baseNameOf p else (p.pname or p.name)}"; ··· 95 115 vim.opt.runtimepath:append('$out') 96 116 97 117 vim.loader.enable() 98 - vim.g.loaded_node_provider = 0 99 - vim.g.loaded_perl_provider = 0 100 - vim.g.loaded_python_provider = 0 101 - vim.g.loaded_python3_provider = 0 102 - vim.g.loaded_ruby_provider = 0 118 + 119 + ${lib.concatMapAttrsStringSep "\n" (provider: enabled: '' 120 + vim.g.loaded_${provider}_provider = ${if enabled then "1" else "0"} 121 + '') pluginProviders} 122 + 123 + ${extraInitLua} 103 124 104 125 do 105 126 vim.cmd.packadd({ "init-plugin", bang = true })