diff mbox series

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

Message ID 39a5e8f9c8f4e3fee5f36824780296f55995ae33.1646227054.git.seerlite@nixnet.email
State New
Headers show
Series vim: Detect plugins via search paths. | 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

Commit Message

SeerLite March 2, 2022, 1:17 p.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(-)

Comments

M March 2, 2022, 6:30 p.m. UTC | #1
SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
0300]:
> +    (native-search-paths
> +      (list (search-path-specification
> +             (variable "GUIX_VIMRUNTIME")
> +             (separator ",")
> +             (files (list "share/vim/vimfiles")))))

this can be simplified:

  (native-search-paths (package-native-search-paths vim))

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 7407ae71d7..3997797201 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -714,7 +714,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)
@@ -730,7 +741,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