1 { lib, stdenv, config, vim-full, macvim, vimPlugins
2 , useMacvim ? stdenv.hostPlatform.isDarwin && (config.vimacs.macvim or true)
3 , vimacsExtraArgs ? "" }:
5 stdenv.mkDerivation rec {
7 version = lib.getVersion vimPackage;
8 vimPackage = if useMacvim then macvim else vim-full;
10 buildInputs = [ vimPackage vimPlugins.vimacs ];
14 cp "${vimPlugins.vimacs}"/bin/vim $out/bin/vimacs
15 substituteInPlace "$out"/bin/vimacs \
16 --replace '-vim}' '-@bin@/bin/vim}' \
17 --replace '-gvim}' '-@bin@/bin/vim -g}' \
18 --replace '--cmd "let g:VM_Enabled = 1"' \
19 '--cmd "let g:VM_Enabled = 1" --cmd "set rtp^=@rtp@" ${vimacsExtraArgs}' \
20 --replace @rtp@ ${vimPlugins.vimacs} \
21 --replace @bin@ ${vimPackage}
22 for prog in vm gvm gvimacs vmdiff vimacsdiff
24 ln -s "$out"/bin/vimacs $out/bin/$prog
29 description = "Vim-Improved eMACS: Emacs emulation for Vim";
30 homepage = "http://algorithm.com.au/code/vimacs";
31 license = licenses.gpl2Plus;
32 maintainers = with lib.maintainers; [ millerjason ];