Message ID | f06b71a730f11b473963e3925d216bf30f7f307e.1646227054.git.seerlite@nixnet.email |
---|---|
State | New |
Headers | show |
Series | vim: Detect plugins via search paths. | expand |
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 |
SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [- 0300]: > -" 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 Nice! That would make the "--pure" option in "guix shell --pure vim perhaps-some-vim-plugins ... -- vim" actually work! (untested, I'm just _looking_ at the patches, not actually testing them) Greetings, Maxime.
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@gmail.com> ;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr> ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com> +;;; Copyright © 2022 SeerLite <seerlite@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