@@ -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"]
@@ -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.
;;;
@@ -108,10 +109,10 @@ (define-public vim
(substitute* "src/testdir/test_autocmd.vim"
(("/bin/kill") (which "kill")))))
(add-before 'check 'set-environment-variables
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs 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 @@ (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