Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion pkgs/applications/editors/neovim/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,22 @@ let
map (x: defaultPlugin // (if (x ? plugin) then x else { plugin = x; })) plugins;


/* accepts a list of normalized plugins and convert themn
/**
accepts a list of normalized plugins and convert them into a vim package

# Type

```
normalizedPluginsToVimPackage :: [AttrSet] -> AttrSet
```

# Examples
:::{.example}

```nix
normalizedPluginsToVimPackage [ { plugin = vim-fugitive; optional = false'} ]
=> { start = [ vim-fugitive ]; opt = []; }
:::
*/
normalizedPluginsToVimPackage = normalizedPlugins:
let
Expand Down
8 changes: 6 additions & 2 deletions pkgs/applications/editors/neovim/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ let
# we call vimrcContent without 'packages' to avoid the init.vim generation
neovimRcContent' = vimUtils.vimrcContent {
beforePlugins = "";
customRC = lib.concatStringsSep "\n" (pluginRC ++ [neovimRcContent]);
customRC = lib.concatStringsSep "\n" (pluginRC ++ lib.optional (neovimRcContent != null) neovimRcContent);
packages = null;
};

packpathDirs.myNeovimPackages = myVimPackage;
finalPackdir = neovimUtils.packDir packpathDirs;

rcContent = ''
Expand All @@ -103,7 +104,6 @@ let
++ (extraPython3Packages ps)
++ (lib.concatMap (f: f ps) pluginPython3Packages));

packpathDirs.myNeovimPackages = myVimPackage;

wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;

Expand Down Expand Up @@ -240,6 +240,10 @@ let
preferLocalBuild = true;

nativeBuildInputs = [ makeWrapper lndir ];

# A Vim "package", see ':h packages'
vimPackage = myVimPackage;

passthru = {
inherit providerLuaRc packpathDirs;
unwrapped = neovim-unwrapped;
Expand Down