diff mbox series

[bug#54221,v2,2/2] gnu: neovim: Search and use installed plugins, like vim.

Message ID 2d93d3dd08699c95c26aa59783a17d8c5cf8635c.1652408245.git.seerlite@nixnet.email
State New
Headers show
Series [bug#54221,v2,1/2] gnu: vim: Use native-search-paths to search for plugins. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

SeerLite May 13, 2022, 2:17 a.m. UTC
* gnu/packages/vim.scm (neovim)[phases]{install-guix.vim}: New phase.
[native-search-paths]: Add search path specification for 'GUIX_VIMRUNTIME'.
---
 gnu/packages/vim.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 0c8e689b5a..530303a318 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -717,7 +717,18 @@  (define-public neovim
              ;; doubles its size.  We remove the refirence here.
              (substitute* "cmake/GetCompileFlags.cmake"
                (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc"))
-             #t)))))
+             #t))
+         (add-after 'install 'install-guix.vim
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((nvimdir (string-append (assoc-ref outputs "out") "/share/nvim")))
+               (mkdir-p nvimdir)
+               (copy-file (assoc-ref inputs "guix.vim")
+                          (string-append nvimdir "/sysinit.vim"))))))))
+    (native-search-paths
+      (list (search-path-specification
+             (variable "GUIX_VIMRUNTIME")
+             (separator ",")
+             (files (list "share/vim/vimfiles")))))
     (inputs
      `(("libuv" ,libuv)
        ("msgpack" ,msgpack)
@@ -739,7 +750,8 @@  (define-public neovim
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("gettext" ,gettext-minimal)
-       ("gperf" ,gperf)))
+       ("gperf" ,gperf)
+       ("guix.vim" ,(search-auxiliary-file "guix.vim"))))
     (home-page "https://neovim.io")
     (synopsis "Fork of vim focused on extensibility and agility")
     (description "Neovim is a project that seeks to aggressively