-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
neovim: add 'autoconfigure' setting #356271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,10 @@ let | |
|
|
||
| wrapper = { | ||
| extraName ? "" | ||
| # certain plugins need a custom configuration (available in passthru.initLua) | ||
| # to work with nix. | ||
| # if true, the wrapper automatically appends those snippets when necessary | ||
| , autoconfigure ? false | ||
| # should contain all args but the binary. Can be either a string or list | ||
| , wrapperArgs ? [] | ||
| , withPython2 ? false | ||
|
|
@@ -87,11 +91,19 @@ let | |
| packpathDirs.myNeovimPackages = myVimPackage; | ||
| finalPackdir = neovimUtils.packDir packpathDirs; | ||
|
|
||
| luaPluginRC = let | ||
| op = acc: normalizedPlugin: | ||
| acc ++ lib.optional (finalAttrs.autoconfigure && normalizedPlugin.plugin.passthru ? initLua) normalizedPlugin.plugin.passthru.initLua; | ||
| in | ||
| lib.foldl' op [] pluginsNormalized; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think so, the accumulator comes first. generated |
||
|
|
||
| rcContent = '' | ||
| ${luaRcContent} | ||
| '' + lib.optionalString (neovimRcContent' != null) '' | ||
| vim.cmd.source "${writeText "init.vim" neovimRcContent'}" | ||
| ''; | ||
| '' + | ||
| lib.concatStringsSep "\n" luaPluginRC | ||
| ; | ||
|
|
||
| getDeps = attrname: map (plugin: plugin.${attrname} or (_: [ ])); | ||
|
|
||
|
|
@@ -155,7 +167,7 @@ let | |
| __structuredAttrs = true; | ||
| dontUnpack = true; | ||
| inherit viAlias vimAlias withNodeJs withPython3 withPerl withRuby; | ||
| inherit wrapRc providerLuaRc packpathDirs; | ||
| inherit autoconfigure wrapRc providerLuaRc packpathDirs; | ||
| inherit python3Env rubyEnv; | ||
| inherit wrapperArgs generatedWrapperArgs; | ||
| luaRcContent = rcContent; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do this on next update ty