vim-utils: include vim man pages in the output of vim_customizable.customize
This commit is contained in:
parent
19eedaf867
commit
b623da79e4
@ -359,19 +359,39 @@ rec {
|
|||||||
inherit vimrcFile;
|
inherit vimrcFile;
|
||||||
|
|
||||||
# shell script with custom name passing [-u vimrc] [-U gvimrc] to vim
|
# shell script with custom name passing [-u vimrc] [-U gvimrc] to vim
|
||||||
vimWithRC = {vimExecutable, name ? null, vimrcFile ? null, gvimrcFile ? null}:
|
vimWithRC = {vimExecutable, gvimExecutable, vimManPages, wrapManual, wrapGui, name ? null, vimrcFile ? null, gvimrcFile ? null}:
|
||||||
let rcOption = o: file: stdenv.lib.optionalString (file != null) "-${o} ${file}";
|
let
|
||||||
in writeScriptBin (if name == null then "vim" else name) ''
|
rcOption = o: file: stdenv.lib.optionalString (file != null) "-${o} ${file}";
|
||||||
#!${stdenv.shell}
|
vimWrapperScript = writeScriptBin (if name == null then "vim" else name) ''
|
||||||
exec ${vimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@"
|
#!${stdenv.shell}
|
||||||
|
exec ${vimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@"
|
||||||
'';
|
'';
|
||||||
|
gvimWrapperScript = writeScriptBin (if name == null then "gvim" else (lib.concatStrings [ "g" name ])) ''
|
||||||
|
#!${stdenv.shell}
|
||||||
|
exec ${gvimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
buildEnv {
|
||||||
|
name = vimWrapperScript.name;
|
||||||
|
paths = [
|
||||||
|
vimWrapperScript
|
||||||
|
] ++ lib.optional wrapGui gvimWrapperScript
|
||||||
|
++ lib.optional wrapManual vimManPages
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
# add a customize option to a vim derivation
|
# add a customize option to a vim derivation
|
||||||
makeCustomizable = vim: vim // {
|
makeCustomizable = vim: vim // {
|
||||||
customize = { name, vimrcConfig }: vimWithRC {
|
customize = { name, vimrcConfig, wrapManual ? true, wrapGui ? false }: vimWithRC {
|
||||||
vimExecutable = "${vim}/bin/vim";
|
vimExecutable = "${vim}/bin/vim";
|
||||||
inherit name;
|
gvimExecutable = "${vim}/bin/gvim";
|
||||||
|
inherit name wrapManual wrapGui;
|
||||||
vimrcFile = vimrcFile vimrcConfig;
|
vimrcFile = vimrcFile vimrcConfig;
|
||||||
|
vimManPages = buildEnv {
|
||||||
|
name = "${name}-doc";
|
||||||
|
paths = [ vim ];
|
||||||
|
pathsToLink = [ "/share/man" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
override = f: makeCustomizable (vim.override f);
|
override = f: makeCustomizable (vim.override f);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user