all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#43539] [PATCH] gnu: vim: Automatically find vim plugins.
@ 2020-09-20 19:15 Efraim Flashner
  2020-09-20 19:29 ` Ricardo Wurmus
  0 siblings, 1 reply; 10+ messages in thread
From: Efraim Flashner @ 2020-09-20 19:15 UTC (permalink / raw)
  To: 43539; +Cc: Efraim Flashner

* gnu/packages/vim.scm (vim)[arguments]: Add new 'install-guix.vim phase
to install vendor specific vimrc.
* gnu/packages/aux-files/guix.vim: New file.
* Makefile.am (AUX_FILES): Register it.
---
 Makefile.am                     |  1 +
 gnu/packages/aux-files/guix.vim |  7 +++++++
 gnu/packages/vim.scm            | 10 +++++++++-
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/aux-files/guix.vim

diff --git a/Makefile.am b/Makefile.am
index 8e91e1e558..d0867ecd22 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -332,6 +332,7 @@ dist_noinst_DATA =				\
 AUX_FILES =						\
   gnu/packages/aux-files/chromium/master-preferences.json		\
   gnu/packages/aux-files/emacs/guix-emacs.el		\
+  gnu/packages/aux-files/guix.vim			\
   gnu/packages/aux-files/linux-libre/5.8-arm.conf       \
   gnu/packages/aux-files/linux-libre/5.8-arm64.conf     \
   gnu/packages/aux-files/linux-libre/5.8-i686.conf      \
diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim
new file mode 100644
index 0000000000..ca97f451d8
--- /dev/null
+++ b/gnu/packages/aux-files/guix.vim
@@ -0,0 +1,7 @@
+" This appends all of the vim plugins to the end of Vim's runtimepath.
+for directory in ["/run/current-system/profile", $HOME . "/.guix-profile", $GUIX_ENVIRONMENT]
+    let testpath = directory . "/share/vim/vimfiles"
+    if isdirectory(testpath)
+        let &rtp = join([&rtp,testpath], ',')
+    endif
+endfor
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index c6b1092e71..dba5b5a38e 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -136,7 +136,14 @@
              (substitute* "src/testdir/test_popupwin.vim"
                ((".*Test_popup_drag_termwin.*" line)
                 (string-append line "return\n")))
-             #t)))))
+             #t))
+         (add-after 'install 'install-guix.vim
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((vimdir (string-append (assoc-ref outputs "out") "/share/vim")))
+               (mkdir-p vimdir)
+               (copy-file (assoc-ref inputs "guix.vim")
+                          (string-append vimdir "/vimrc"))
+               #t))))))
     (inputs
      `(("gawk" ,gawk)
        ("ncurses" ,ncurses)
@@ -144,6 +151,7 @@
        ("tcsh" ,tcsh)))                 ; For runtime/tools/vim32
     (native-inputs
      `(("libtool" ,libtool)
+       ("guix.vim" ,(search-auxiliary-file "guix.vim"))
 
        ;; For tests.
        ("tzdata" ,tzdata-for-tests)))
-- 
2.28.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-12-20 11:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-20 19:15 [bug#43539] [PATCH] gnu: vim: Automatically find vim plugins Efraim Flashner
2020-09-20 19:29 ` Ricardo Wurmus
2020-09-20 19:32   ` Efraim Flashner
2020-09-20 19:50     ` Ricardo Wurmus
2020-09-20 20:57       ` Efraim Flashner
2020-09-22  9:37         ` Efraim Flashner
2020-09-25 17:48           ` Marius Bakke
2020-09-27  8:49             ` Efraim Flashner
2020-09-27  9:41               ` Efraim Flashner
2020-12-20 11:10             ` bug#43539: " Efraim Flashner

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.