@ -12,8 +12,8 @@ neovim:
let
wrapper = {
extraName ? " "
# should contain all args but the binary
, wrapperArgs ? " "
# should contain all args but the binary. Can be either a string or list
, wrapperArgs ? [ ]
, manifestRc ? null
, withPython2 ? false
, withPython3 ? true , python3Env ? null
@ -21,10 +21,18 @@ let
, rubyEnv ? null
, vimAlias ? false
, viAlias ? false
# additional argument not generated by makeNeovimConfig
# it will append "-u <customRc>" to the wrapped arguments
# set to false if you want to control where to save the generated config
# (e.g., in ~/.config/init.vim or project/.nvimrc)
, wrapRc ? true
, . . .
} :
} @ args :
let
wrapperArgsStr = if isString wrapperArgs then wrapperArgs else lib . escapeShellArgs wrapperArgs ;
# If configure != {}, we can't generate the rplugin.vim file with e.g
# NVIM_SYSTEM_RPLUGIN_MANIFEST *and* NVIM_RPLUGIN_MANIFEST env vars set in
# the wrapper. That's why only when configure != {} (tested both here and
@ -32,8 +40,10 @@ let
# wrapper with most arguments we need, excluding those that cause problems to
# generate rplugin.vim, but still required for the final wrapper.
finalMakeWrapperArgs =
[ " ${ neovim } / b i n / n v i m " " ${ placeholder " o u t " } / b i n / n v i m " ] ++
[ " - - s e t " " N V I M _ S Y S T E M _ R P L U G I N _ M A N I F E S T " " ${ placeholder " o u t " } / r p l u g i n . v i m " ] ;
[ " ${ neovim } / b i n / n v i m " " ${ placeholder " o u t " } / b i n / n v i m " ]
++ [ " - - s e t " " N V I M _ S Y S T E M _ R P L U G I N _ M A N I F E S T " " ${ placeholder " o u t " } / r p l u g i n . v i m " ]
++ optionals wrapRc [ " - - a d d - f l a g s " " - u ${ writeText " i n i t . v i m " args . neovimRcContent } " ]
;
in
assert withPython2 -> throw " P y t h o n 2 s u p p o r t h a s b e e n r e m o v e d f r o m t h e n e o v i m w r a p p e r , p l e a s e r e m o v e w i t h P y t h o n 2 a n d p y t h o n 2 E n v . " ;
@ -67,7 +77,7 @@ let
in ''
echo " G e n e r a t i n g r e m o t e p l u g i n m a n i f e s t "
export NVIM_RPLUGIN_MANIFEST = $ out/rplugin.vim
makeWrapper $ { lib . escapeShellArgs manifestWrapperArgs } $ { wrapperArgs }
makeWrapper $ { lib . escapeShellArgs manifestWrapperArgs } $ { wrapperArgsStr }
# Some plugins assume that the home directory is accessible for
# initializing caches, temporary files, etc. Even if the plugin isn't
@ -97,7 +107,7 @@ let
'' )
+ ''
rm $ out/bin/nvim
makeWrapper $ { lib . escapeShellArgs finalMakeWrapperArgs } $ { wrapperArgs }
makeWrapper $ { lib . escapeShellArgs finalMakeWrapperArgs } $ { wrapperArgsStr }
'' ;
paths = [ neovim ] ;