2022-12-04 11:18:38 +01:00
|
|
|
{ lib, stdenv, config, vim-full, macvim, vimPlugins
|
2020-03-08 06:16:53 +01:00
|
|
|
, useMacvim ? stdenv.isDarwin && (config.vimacs.macvim or true)
|
|
|
|
, vimacsExtraArgs ? "" }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vimacs";
|
2021-02-04 22:27:38 +01:00
|
|
|
version = lib.getVersion vimPackage;
|
2022-12-04 11:18:38 +01:00
|
|
|
vimPackage = if useMacvim then macvim else vim-full;
|
2020-03-08 06:16:53 +01:00
|
|
|
|
|
|
|
buildInputs = [ vimPackage vimPlugins.vimacs ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p "$out"/bin
|
2021-09-02 01:20:05 +02:00
|
|
|
cp "${vimPlugins.vimacs}"/bin/vim $out/bin/vimacs
|
2020-03-08 06:16:53 +01:00
|
|
|
substituteInPlace "$out"/bin/vimacs \
|
|
|
|
--replace '-vim}' '-@bin@/bin/vim}' \
|
|
|
|
--replace '-gvim}' '-@bin@/bin/vim -g}' \
|
|
|
|
--replace '--cmd "let g:VM_Enabled = 1"' \
|
|
|
|
'--cmd "let g:VM_Enabled = 1" --cmd "set rtp^=@rtp@" ${vimacsExtraArgs}' \
|
2022-09-29 18:31:05 +02:00
|
|
|
--replace @rtp@ ${vimPlugins.vimacs} \
|
2020-03-08 06:16:53 +01:00
|
|
|
--replace @bin@ ${vimPackage}
|
|
|
|
for prog in vm gvm gvimacs vmdiff vimacsdiff
|
|
|
|
do
|
|
|
|
ln -s "$out"/bin/vimacs $out/bin/$prog
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-03-08 06:16:53 +01:00
|
|
|
description = "Vim-Improved eMACS: Emacs emulation for Vim";
|
|
|
|
homepage = "http://algorithm.com.au/code/vimacs";
|
|
|
|
license = licenses.gpl2Plus;
|
2021-01-15 14:21:58 +01:00
|
|
|
maintainers = with lib.maintainers; [ millerjason ];
|
2020-03-08 06:16:53 +01:00
|
|
|
};
|
|
|
|
}
|