summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeerLite <seerlite@nixnet.email>2022-05-18 21:14:04 -0400
committerGuix Patches Tester <>2022-05-19 02:16:08 +0100
commitcabbcae1d34ecab2146f277590ecc40f51c14ae0 (patch)
tree081d87668aa42226ef98b613413b468bcd264885
parentef55192ef8a0d9bd336731350f73b709ffd101a0 (diff)
downloadguix-patches-cabbcae1d34ecab2146f277590ecc40f51c14ae0.tar
guix-patches-cabbcae1d34ecab2146f277590ecc40f51c14ae0.tar.gz
gnu: vim: Use native-search-paths to search for plugins.series-12393
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'. [phases]: Search for tzdata files in the correct input fields.
-rw-r--r--gnu/packages/aux-files/guix.vim11
-rw-r--r--gnu/packages/vim.scm8
2 files changed, 11 insertions, 8 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 bb459933b0..ebf5f58ced 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
+;;; Copyright © 2022 SeerLite <seerlite@nixnet.email>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -111,7 +112,7 @@
(lambda* (#:key inputs #:allow-other-keys)
;; One of the tests tests timezone-dependent functions.
(setenv "TZDIR"
- (search-input-directory inputs "share/zoneinfo"))
+ (search-input-directory (or native-inputs inputs) "share/zoneinfo"))
;; Make sure the TERM environment variable is set for the tests
(setenv "TERM" "xterm")))
@@ -147,6 +148,11 @@
(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