diff mbox series

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

Message ID 0313ee2476aeb999ca0f73609f2eff54865028bc.1677096448.git.seerlite@disroot.org
State New
Headers show
Series [bug#54221,1/2] gnu: vim: Use native-search-paths to search for plugins. | expand

Commit Message

SeerLite Feb. 22, 2023, 8:07 p.m. UTC
* gnu/packages/vim.scm (neovim)[phases]: Add 'install-guix.vim phase
and remove trailing #t's.
[native-search-paths]: Add search path specification for 'GUIX_VIMRUNTIME'.
---
 gnu/packages/vim.scm | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Comments

Liliana Marie Prikler Aug. 5, 2023, 12:34 p.m. UTC | #1
Am Mittwoch, dem 22.02.2023 um 17:07 -0300 schrieb SeerLite:
> * gnu/packages/vim.scm (neovim)[phases]: Add 'install-guix.vim phase
> and remove trailing #t's.
Again, should be [#:phases].
When you need to join sentences with "and" it's typically a sign that
these are unrelated changes.  At the very least, you should write out
those sentences.  I'm also a proponent of doing stylistic changes in a
separate patch, but since you're already waiting for this a long time,
I'm willing to take this series without that.
> [native-search-paths]: Add search path specification for
> 'GUIX_VIMRUNTIME'.
Can we inherit this from vim via (package-native-search-paths vim)?

Sadly, this patch currently doesn't apply on master; or at least what I
have for master, which lacks any changes in vim.scm, though.  Could you
send one with these points adjusted and --reroll-count=8?

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index d4e4f88756..c6bcd096a0 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -751,16 +751,25 @@  (define-public neovim
                      (setenv "LUA_PATH"
                              (string-join (map lua-path-spec lua-inputs) ";"))
                      (setenv "LUA_CPATH"
-                             (string-join (map lua-cpath-spec lua-inputs) ";"))
-                     #t)))
+                             (string-join (map lua-cpath-spec lua-inputs) ";")))))
                (add-after 'unpack 'prevent-embedding-gcc-store-path
                  (lambda _
                    ;; nvim remembers its build options, including the compiler with
                    ;; its complete path.  This adds gcc to the closure of nvim, which
                    ;; doubles its size.  We remove the refirence here.
                    (substitute* "cmake/GetCompileFlags.cmake"
-                     (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc"))
-                   #t)))))
+                     (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc"))))
+               (add-after 'install 'install-guix.vim
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (let ((vimdir (string-append (assoc-ref outputs "out") "/share/nvim"))
+                         (vimrc #$(local-file (search-auxiliary-file "guix.vim"))))
+                     (mkdir-p vimdir)
+                     (copy-file vimrc (string-append vimdir "/sysinit.vim"))))))))
+    (native-search-paths
+      (list (search-path-specification
+             (variable "GUIX_VIMRUNTIME")
+             (separator ",")
+             (files (list "share/vim/vimfiles")))))
     (inputs (list libuv-for-luv
                   msgpack
                   libtermkey