GNU bug report logs - #54221
[PATCH 0/4] vim: Detect plugins via search paths.

Previous Next

Package: guix-patches;

Reported by: SeerLite <seerlite <at> nixnet.email>

Date: Wed, 2 Mar 2022 13:15:01 UTC

Severity: normal

Tags: patch

Full log


Message #8 received at 54221 <at> debbugs.gnu.org (full text, mbox):

From: SeerLite <seerlite <at> nixnet.email>
To: 54221 <at> debbugs.gnu.org
Cc: SeerLite <seerlite <at> nixnet.email>
Subject: [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins.
Date: Wed,  2 Mar 2022 10:17:32 -0300
Previously a hardcoded list of directories was used, which albeit quite
accurate during normal use, didn't fully respect the active Guix environment
and didn't make use of Guix's search-paths feature.

* gnu/packages/aux-files/guix.vim: Use 'GUIX_VIMRUNTIME' to set the runtimepath.
* gnu/packages/vim.scm (vim)[native-search-paths]: Add search path
specification for 'GUIX_VIMRUNTIME'.
---
 gnu/packages/aux-files/guix.vim | 11 ++++-------
 gnu/packages/vim.scm            |  6 ++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim
index 9397c53701..3c13a16b7d 100644
--- a/gnu/packages/aux-files/guix.vim
+++ b/gnu/packages/aux-files/guix.vim
@@ -1,10 +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", $HOME ."/.guix-home/profile", $GUIX_PROFILE, $GUIX_ENVIRONMENT]
-    let vimplugins = directory . "/share/vim/vimfiles"
-    if isdirectory(vimplugins)
-        let &rtp = join([&rtp,vimplugins], ',')
-    endif
-endfor
+if !empty($GUIX_VIMRUNTIME)
+    set rtp+=$GUIX_VIMRUNTIME
+endif
+
 " Unconditionally add */after directories last, as intended by upstream
 " TODO: Remove duplicate */after directories
 for directory in [$VIM . "/vimfiles", $HOME ."/.vim"]
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 28944dd640..7407ae71d7 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;; Copyright © 2021 Tissevert <tissevert+guix <at> marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo <at> hotmail.com>
+;;; Copyright © 2022 SeerLite <seerlite <at> nixnet.email>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -150,6 +151,11 @@ (define-public vim
                (mkdir-p vimdir)
                (copy-file (assoc-ref inputs "guix.vim")
                           (string-append vimdir "/vimrc"))))))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "GUIX_VIMRUNTIME")
+            (separator ",")
+            (files (list "share/vim/vimfiles")))))
     (inputs
      (list gawk ncurses perl tcsh))                 ; For runtime/tools/vim32
     (native-inputs
-- 
2.34.0





This bug report was last modified 1 year and 315 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.