about summary refs log tree commit diff
path: root/pkgs/applications/editors/vim
diff options
context:
space:
mode:
authorJason Miller <mailings-github@millerjason.com>2020-03-08 00:16:53 -0500
committerJason Miller <mailings-github@millerjason.com>2020-03-27 14:39:22 -0400
commit4234ef550c6646ef34b6888730b05173a8648334 (patch)
tree31a947e55da7461bc50731cac367cb982c638acb /pkgs/applications/editors/vim
parent40d3bc2d9f75c3a613d93f34d4e26d901b90f51e (diff)
vimacs: init at 2016-03-24
Diffstat (limited to 'pkgs/applications/editors/vim')
-rw-r--r--pkgs/applications/editors/vim/vimacs.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/applications/editors/vim/vimacs.nix b/pkgs/applications/editors/vim/vimacs.nix
new file mode 100644
index 0000000000000..d067b4181213d
--- /dev/null
+++ b/pkgs/applications/editors/vim/vimacs.nix
@@ -0,0 +1,34 @@
+{ stdenv, config, vim_configurable, macvim, vimPlugins
+, useMacvim ? stdenv.isDarwin && (config.vimacs.macvim or true)
+, vimacsExtraArgs ? "" }:
+
+stdenv.mkDerivation rec {
+  pname = "vimacs";
+  version = vimPackage.version;
+  vimPackage = if useMacvim then macvim else vim_configurable;
+
+  buildInputs = [ vimPackage vimPlugins.vimacs ];
+
+  buildCommand = ''
+    mkdir -p "$out"/bin
+    cp "${vimPlugins.vimacs}"/share/vim-plugins/vimacs/bin/vim $out/bin/vimacs
+    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}' \
+      --replace @rtp@ ${vimPlugins.vimacs.rtp} \
+      --replace @bin@ ${vimPackage}
+    for prog in vm gvm gvimacs vmdiff vimacsdiff
+    do
+      ln -s "$out"/bin/vimacs $out/bin/$prog
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Vim-Improved eMACS: Emacs emulation for Vim";
+    homepage = "http://algorithm.com.au/code/vimacs";
+    license = licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [ millerjason ];
+  };
+}