[PATCH] gnu: vim: Automatically find vim plugins.

DoneSubmitted by Efraim Flashner.
Details
3 participants
  • Efraim Flashner
  • Marius Bakke
  • Ricardo Wurmus
Owner
unassigned
Severity
normal
E
E
Efraim Flashner wrote on 20 Sep 2020 21:15
(address . guix-patches@gnu.org)(name . Efraim Flashner)(address . efraim@flashner.co.il)
20200920191523.6871-1-efraim@flashner.co.il
* gnu/packages/vim.scm (vim)[arguments]: Add new 'install-guix.vim phaseto install vendor specific vimrc.* gnu/packages/aux-files/guix.vim: New file.* Makefile.am (AUX_FILES): Register it.--- Makefile.am | 1 + gnu/packages/aux-files/guix.vim | 7 +++++++ gnu/packages/vim.scm | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/guix.vim
Toggle diff (55 lines)diff --git a/Makefile.am b/Makefile.amindex 8e91e1e558..d0867ecd22 100644--- a/Makefile.am+++ b/Makefile.am@@ -332,6 +332,7 @@ dist_noinst_DATA = \ AUX_FILES = \ gnu/packages/aux-files/chromium/master-preferences.json \ gnu/packages/aux-files/emacs/guix-emacs.el \+ gnu/packages/aux-files/guix.vim \ gnu/packages/aux-files/linux-libre/5.8-arm.conf \ gnu/packages/aux-files/linux-libre/5.8-arm64.conf \ gnu/packages/aux-files/linux-libre/5.8-i686.conf \diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vimnew file mode 100644index 0000000000..ca97f451d8--- /dev/null+++ b/gnu/packages/aux-files/guix.vim@@ -0,0 +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", $GUIX_ENVIRONMENT]+ let testpath = directory . "/share/vim/vimfiles"+ if isdirectory(testpath)+ let &rtp = join([&rtp,testpath], ',')+ endif+endfordiff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scmindex c6b1092e71..dba5b5a38e 100644--- a/gnu/packages/vim.scm+++ b/gnu/packages/vim.scm@@ -136,7 +136,14 @@ (substitute* "src/testdir/test_popupwin.vim" ((".*Test_popup_drag_termwin.*" line) (string-append line "return\n")))- #t)))))+ #t))+ (add-after 'install 'install-guix.vim+ (lambda* (#:key inputs outputs #:allow-other-keys)+ (let ((vimdir (string-append (assoc-ref outputs "out") "/share/vim")))+ (mkdir-p vimdir)+ (copy-file (assoc-ref inputs "guix.vim")+ (string-append vimdir "/vimrc"))+ #t)))))) (inputs `(("gawk" ,gawk) ("ncurses" ,ncurses)@@ -144,6 +151,7 @@ ("tcsh" ,tcsh))) ; For runtime/tools/vim32 (native-inputs `(("libtool" ,libtool)+ ("guix.vim" ,(search-auxiliary-file "guix.vim")) ;; For tests. ("tzdata" ,tzdata-for-tests)))-- 2.28.0
R
R
Ricardo Wurmus wrote on 20 Sep 2020 21:29
(name . Efraim Flashner)(address . efraim@flashner.co.il)
87bli0tffs.fsf@elephly.net
Efraim Flashner <efraim@flashner.co.il> writes:
Toggle quote (9 lines)> diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim> new file mode 100644> index 0000000000..ca97f451d8> --- /dev/null> +++ b/gnu/packages/aux-files/guix.vim> @@ -0,0 +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", $GUIX_ENVIRONMENT]
How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?This would allow users to keep a separate profile for Vim things.
-- Ricardo
E
E
Efraim Flashner wrote on 20 Sep 2020 21:32
(name . Ricardo Wurmus)(address . rekado@elephly.net)
20200920193215.GA6984@E5400
On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:
Toggle quote (15 lines)> > Efraim Flashner <efraim@flashner.co.il> writes:> > > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim> > new file mode 100644> > index 0000000000..ca97f451d8> > --- /dev/null> > +++ b/gnu/packages/aux-files/guix.vim> > @@ -0,0 +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", $GUIX_ENVIRONMENT]> > How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?> This would allow users to keep a separate profile for Vim things.
That was the one part I didn't really like about my patch. UnfortunatelyI don't seem to have $GUIX_PROFILE set on my machine.
(ins)efraim@E5400 ~$ echo $GUIX_PROFILE
(ins)efraim@E5400 ~$
-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9nrjwACgkQQarn3Mo9g1G4ARAAo1ALsWRisnX5ItiqH/udKHRe0JWWfR/GyS1PmjkIP3JZtc+hSld4yggGHJaQsK8nXBUmCbjoEe5Bxs7q52nmU3Edr2jQo0nazQuP+bV7Wc5dZxH4GUt7g1ByXuR0qjKqdZsxKRU3T5JH/AHj5N8RFhjuzzLquuAWjKwXM44FEgZcNI0JRUoh+zHFzc+OezkjrLpUFWH/Ahy41oB3SgTYjWd5mmOB0wDdT5nbzG+92Zx/jTN5e8BimgI48YOa9Xr6ngVsgIuHIhaUbvLBJ2Dejh0H3IyW18wgK4aox3MAMImqcLWcGtKzLnwStNPljE8tEChlVbvq+FmU/vrJjoqXaDaFRFKjZ5k1aA8ETTQUUq8e3HXJOLV+5YGqqPm+HuDylNCzHoNRpjr8qx8bVAB4JIR0ytcSIyp/4KknFgn85Hnzbs/HnFFUpect82x0hMBzZj1EmW2/7O6Fj1TazSYujpMY/oz/5UIhhPENCuMGCWSbk/SMJ9ZkBW2r+S8JkSAGK4RSXjvdSCS0pis02U7Ru4AoXjwPKlzqTC459mO91rAZHQPpovH442a8Hk8D64JPSh2/LCJ07sxwruK1GzlQ0CSWh6QrC7PYYMwnD9VvOFeMbn6q35jqFJ1q6gskw+/5+w26OZy6SURamP/ZJIc/V4i4WWhZ2zVem+XEJjjDPNk==pijM-----END PGP SIGNATURE-----

R
R
Ricardo Wurmus wrote on 20 Sep 2020 21:50
(name . Efraim Flashner)(address . efraim@flashner.co.il)
875z88teh7.fsf@elephly.net
Efraim Flashner <efraim@flashner.co.il> writes:
Toggle quote (23 lines)> On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:>> >> Efraim Flashner <efraim@flashner.co.il> writes:>> >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim>> > new file mode 100644>> > index 0000000000..ca97f451d8>> > --- /dev/null>> > +++ b/gnu/packages/aux-files/guix.vim>> > @@ -0,0 +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", $GUIX_ENVIRONMENT]>> >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?>> This would allow users to keep a separate profile for Vim things.>> That was the one part I didn't really like about my patch. Unfortunately> I don't seem to have $GUIX_PROFILE set on my machine.>> (ins)efraim@E5400 ~$ echo $GUIX_PROFILE>> (ins)efraim@E5400 ~$
Me neither! But when loading profiles we suggest this approach:
export GUIX_PROFILE=/the/location/of/the/.guix-profile source $GUIX_PROFILE/etc/profile
The variable is set in that case, because that affects whether absolutestore file names are used or the symlink“/the/location/of/the/.guix-profile”.
-- Ricardo
E
E
Efraim Flashner wrote on 20 Sep 2020 22:57
(name . Ricardo Wurmus)(address . rekado@elephly.net)
20200920205758.GD6984@E5400
On Sun, Sep 20, 2020 at 09:50:12PM +0200, Ricardo Wurmus wrote:
Toggle quote (35 lines)> > Efraim Flashner <efraim@flashner.co.il> writes:> > > On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:> >> > >> Efraim Flashner <efraim@flashner.co.il> writes:> >> > >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim> >> > new file mode 100644> >> > index 0000000000..ca97f451d8> >> > --- /dev/null> >> > +++ b/gnu/packages/aux-files/guix.vim> >> > @@ -0,0 +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", $GUIX_ENVIRONMENT]> >> > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?> >> This would allow users to keep a separate profile for Vim things.> >> > That was the one part I didn't really like about my patch. Unfortunately> > I don't seem to have $GUIX_PROFILE set on my machine.> >> > (ins)efraim@E5400 ~$ echo $GUIX_PROFILE> >> > (ins)efraim@E5400 ~$> > Me neither! But when loading profiles we suggest this approach:> > export GUIX_PROFILE=/the/location/of/the/.guix-profile> source $GUIX_PROFILE/etc/profile> > The variable is set in that case, because that affects whether absolute> store file names are used or the symlink> “/the/location/of/the/.guix-profile”.
It seems to be the case for the default profile. And in Guix System. Icould also just add $GUIX_PROFILE as another location in the list ofdirectories to search.
-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9nwlUACgkQQarn3Mo9g1Ev2Q/8CKDe701tcSRVBT/XgcZywmFDfzVsxFtzXLYiXixwo62I8GaPSe8ha46vE8R3Ewgr/P2sXbOAlj7OS/Am2cGHeYiKgOk8PXkVaxBBxhHH3KkSAE/5962MwBR1MhZUeIhy9Pkrgh4yihD2lDELFjIer01q+dkieEPeev9/CA9+XxpsoCaByi1UA8b8nbnkjVbxeEzwKTF2hHWH0EW3xdCMvkJm+CEA4fi9FM4AH5yAQ5iwcvte895PHIF6+f/aBIq7XppOmS8GCmyRVeX6+eIwpHUraOcuG2Ps0Bq/lxHNVHIZ4IYZtJ9ykU4uGrHfk6r7L2wRK7fOTtyoZPcz2noD8rM6AYICr3oBBVhVOGT1rdMrE2mmWlELUoVUVA9EXP7W4x4pMyHlLXrIiQoqmNwRbK0OtrWsGBhIDm2Qsq7n7aHOOXcXwIXygy/w2Ky7rxTs7ZE7dwkJO2BxVa7vhp9yo/ENSR70yOzXtceGhqRlNI1odjYQG72DCTULy7zNsjE9j887yuvvwbubI3gfyg8wuqSXM3RC6inTRtPLv0GYwRm7siJ2qVJdjwut84c6qAH6YST/N7iPy9r3Twdhz+lOODrXp6ODYpUCQZuGlaHMUsJtU/CoHHYFz8yXQEjoAJnjNS0kwvYXFkmTdvkik9/h0OdHHsXYxvMz+OpXA2R3GBQ==eDb4-----END PGP SIGNATURE-----

E
E
Efraim Flashner wrote on 22 Sep 2020 11:37
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 43539@debbugs.gnu.org)
20200922093734.GF1007@E5400
On Sun, Sep 20, 2020 at 11:57:58PM +0300, Efraim Flashner wrote:
Toggle quote (40 lines)> On Sun, Sep 20, 2020 at 09:50:12PM +0200, Ricardo Wurmus wrote:> > > > Efraim Flashner <efraim@flashner.co.il> writes:> > > > > On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:> > >> > > >> Efraim Flashner <efraim@flashner.co.il> writes:> > >> > > >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim> > >> > new file mode 100644> > >> > index 0000000000..ca97f451d8> > >> > --- /dev/null> > >> > +++ b/gnu/packages/aux-files/guix.vim> > >> > @@ -0,0 +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", $GUIX_ENVIRONMENT]> > >> > > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?> > >> This would allow users to keep a separate profile for Vim things.> > >> > > That was the one part I didn't really like about my patch. Unfortunately> > > I don't seem to have $GUIX_PROFILE set on my machine.> > >> > > (ins)efraim@E5400 ~$ echo $GUIX_PROFILE> > >> > > (ins)efraim@E5400 ~$> > > > Me neither! But when loading profiles we suggest this approach:> > > > export GUIX_PROFILE=/the/location/of/the/.guix-profile> > source $GUIX_PROFILE/etc/profile> > > > The variable is set in that case, because that affects whether absolute> > store file names are used or the symlink> > “/the/location/of/the/.guix-profile”.> > It seems to be the case for the default profile. And in Guix System. I> could also just add $GUIX_PROFILE as another location in the list of> directories to search.
The more I think about it the more I see $HOME/.guix-profile as a"special profile" which is nearly always included in $PATH and othervariables, similar to /run/current-system/profile. With that in mind Ilike the attached patch which keeps that path but adds a search for$GUIX_PROFILE.
I could use environment variables to override vim's builtin search for$VIM and $VIMRUNTIME, but then we would have to decide to support viminstalled by the user or system-wide.

-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
From 89a465c32a1d75a473cb643c49bbf65c093b1d4e Mon Sep 17 00:00:00 2001From: Efraim Flashner <efraim@flashner.co.il>Date: Fri, 18 Sep 2020 18:25:06 +0300Subject: [PATCH] gnu: vim: Automatically find vim plugins.
* gnu/packages/vim.scm (vim)[arguments]: Add new 'install-guix.vim phaseto install vendor specific vimrc.* gnu/packages/aux-files/guix.vim: New file.* Makefile.am (AUX_FILES): Register it.--- Makefile.am | 1 + gnu/packages/aux-files/guix.vim | 7 +++++++ gnu/packages/vim.scm | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/guix.vim
Toggle diff (55 lines)diff --git a/Makefile.am b/Makefile.amindex 8e91e1e558..d0867ecd22 100644--- a/Makefile.am+++ b/Makefile.am@@ -332,6 +332,7 @@ dist_noinst_DATA = \ AUX_FILES = \ gnu/packages/aux-files/chromium/master-preferences.json \ gnu/packages/aux-files/emacs/guix-emacs.el \+ gnu/packages/aux-files/guix.vim \ gnu/packages/aux-files/linux-libre/5.8-arm.conf \ gnu/packages/aux-files/linux-libre/5.8-arm64.conf \ gnu/packages/aux-files/linux-libre/5.8-i686.conf \diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vimnew file mode 100644index 0000000000..7dc359e52b--- /dev/null+++ b/gnu/packages/aux-files/guix.vim@@ -0,0 +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", $GUIX_PROFILE, $GUIX_ENVIRONMENT]+ let vimplugins = directory . "/share/vim/vimfiles"+ if isdirectory(vimplugins)+ let &rtp = join([&rtp,vimplugins], ',')+ endif+endfordiff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scmindex c6b1092e71..dba5b5a38e 100644--- a/gnu/packages/vim.scm+++ b/gnu/packages/vim.scm@@ -136,7 +136,14 @@ (substitute* "src/testdir/test_popupwin.vim" ((".*Test_popup_drag_termwin.*" line) (string-append line "return\n")))- #t)))))+ #t))+ (add-after 'install 'install-guix.vim+ (lambda* (#:key inputs outputs #:allow-other-keys)+ (let ((vimdir (string-append (assoc-ref outputs "out") "/share/vim")))+ (mkdir-p vimdir)+ (copy-file (assoc-ref inputs "guix.vim")+ (string-append vimdir "/vimrc"))+ #t)))))) (inputs `(("gawk" ,gawk) ("ncurses" ,ncurses)@@ -144,6 +151,7 @@ ("tcsh" ,tcsh))) ; For runtime/tools/vim32 (native-inputs `(("libtool" ,libtool)+ ("guix.vim" ,(search-auxiliary-file "guix.vim")) ;; For tests. ("tzdata" ,tzdata-for-tests)))-- 2.28.0
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9pxd4ACgkQQarn3Mo9g1FpTxAAj7OTWGpC8E02ZUn9b6CysQhTG3+WRYH6edLKGR/Ry0hevWR/qJT7j421yJbEhfiRsX/5obfoV+YC1Zmh3sp/Nc/qEM1RW3+2ONiPrpvFHUMSjI5WYqXTsiNKncpUsSeFmfGc+vMbiWG0NxRm4oGsrbLTvHcjdv3SZoxRyq0w0OsLx+s1dupknuzFbY8PJQH1fdKYJsHuSS8GVsnkn72kqTWfnp+YFGC5iTAmoUvrRpT0om97Dzy0U0OqhCowNwuheB3HotgmJLmmU2AWwsYJhOwhB4VDChwnDfh6iGB/6ayRMhnzmFpUb0whKk2qLNBWGQVefoKeynCCwBjHFKRO+YgvojE11+WcZsOt2yS5HGRal6S5gWxjnoJ6F4tWeVnXDOs/ClgCla4oG3kAkBuWKzvz6qS2qILlseZuMSnbSXe3OoKrxDlZR/xz4f91OEove5SHL4V6ZBIDxQQ61a+4GfFld/DvqcA3/NmBnhexdwkPZubZJ2Fnnc7JhnQ7zR0tOylvShroAKNpQRwoE0P3w8rjFqLWuaf6WB+UdckoUOhSC1xOeNqXyNIgvtNKrkjn3ui0M+bW2nIqc3EKJeDaLi/Wn+eVjqxCURtmFjcxVCc8DjtEyHkBTbJwgjZNzseRAejmfYRP5zwuPkvEx1h+wfJaw+JQnKUVWQUlZr7FUL0==peO0-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 25 Sep 2020 19:48
(address . 43539@debbugs.gnu.org)
87o8lt4uj1.fsf@gnu.org
Efraim Flashner <efraim@flashner.co.il> writes:
Toggle quote (51 lines)> On Sun, Sep 20, 2020 at 11:57:58PM +0300, Efraim Flashner wrote:>> On Sun, Sep 20, 2020 at 09:50:12PM +0200, Ricardo Wurmus wrote:>> > >> > Efraim Flashner <efraim@flashner.co.il> writes:>> > >> > > On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:>> > >> >> > >> Efraim Flashner <efraim@flashner.co.il> writes:>> > >> >> > >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim>> > >> > new file mode 100644>> > >> > index 0000000000..ca97f451d8>> > >> > --- /dev/null>> > >> > +++ b/gnu/packages/aux-files/guix.vim>> > >> > @@ -0,0 +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", $GUIX_ENVIRONMENT]>> > >> >> > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?>> > >> This would allow users to keep a separate profile for Vim things.>> > >>> > > That was the one part I didn't really like about my patch. Unfortunately>> > > I don't seem to have $GUIX_PROFILE set on my machine.>> > >>> > > (ins)efraim@E5400 ~$ echo $GUIX_PROFILE>> > >>> > > (ins)efraim@E5400 ~$>> > >> > Me neither! But when loading profiles we suggest this approach:>> > >> > export GUIX_PROFILE=/the/location/of/the/.guix-profile>> > source $GUIX_PROFILE/etc/profile>> > >> > The variable is set in that case, because that affects whether absolute>> > store file names are used or the symlink>> > “/the/location/of/the/.guix-profile”.>> >> It seems to be the case for the default profile. And in Guix System. I>> could also just add $GUIX_PROFILE as another location in the list of>> directories to search.>> The more I think about it the more I see $HOME/.guix-profile as a> "special profile" which is nearly always included in $PATH and other> variables, similar to /run/current-system/profile. With that in mind I> like the attached patch which keeps that path but adds a search for> $GUIX_PROFILE.>> I could use environment variables to override vim's builtin search for> $VIM and $VIMRUNTIME, but then we would have to decide to support vim> installed by the user or system-wide.
So vim only expects a single vimfiles directory in those variables?
[...]
Toggle quote (10 lines)> +++ b/gnu/packages/aux-files/guix.vim> @@ -0,0 +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", $GUIX_PROFILE, $GUIX_ENVIRONMENT]> + let vimplugins = directory . "/share/vim/vimfiles"> + if isdirectory(vimplugins)> + let &rtp = join([&rtp,vimplugins], ',')> + endif> +endfor
I wonder if we could generalize this to a proper search path withsomething like (pseudo code):
for directory in getenv("VIM_PLUGIN_PATH").split(":") let vimplugins = directory . "share/vim/vimfiles" ...
And then in the vim package:
(native-search-paths (list (search-path-specification (variable "VIM_PLUGIN_PATH") (files '("share/vim/vimfiles")))))
...which makes Guix populate VIM_PLUGIN_PATH automatically as pluginsare added to a profile/environment (as long as it contains the 'vim'package).
WDYT?
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl9uLXIACgkQoqBt8qM6VPqW4Qf/efuJfE46Cnzkbp83/17JqH9PlABcsPT0+nOYQg3weDiIClx+8NxA1Fe4T2Kd48jAkFGIRn/z95dZB7eCH3rPNIcIWyoNKIbn6kerR49hVZiCleucC/JnC4fnZaXDwqYzhkYWHXgfmbrussfbpb21G3ZMlnZEaAV+pvqF+Ag84+mZCLELW2ygzq79alWMgaBal7Nl4qFjC15gGK+4/oLB80RAXIvTO1Th3p+X1uA+Xxk6lfaMR6OQBq06rKmqymADA+T47dJGnJwNH0L6t9a6uC24Ze8C2m1Y0rN9ys7KGVF9t7UuvcEveu4HJv78ocRuMM641OByW1IAKXe4x9eSyQ===rlr8-----END PGP SIGNATURE-----
E
E
Efraim Flashner wrote on 27 Sep 2020 10:49
(name . Marius Bakke)(address . marius@gnu.org)
20200927084951.GC1386@E5400
On Fri, Sep 25, 2020 at 07:48:34PM +0200, Marius Bakke wrote:
Toggle quote (56 lines)> Efraim Flashner <efraim@flashner.co.il> writes:> > > On Sun, Sep 20, 2020 at 11:57:58PM +0300, Efraim Flashner wrote:> >> On Sun, Sep 20, 2020 at 09:50:12PM +0200, Ricardo Wurmus wrote:> >> > > >> > Efraim Flashner <efraim@flashner.co.il> writes:> >> > > >> > > On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:> >> > >> > >> > >> Efraim Flashner <efraim@flashner.co.il> writes:> >> > >> > >> > >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim> >> > >> > new file mode 100644> >> > >> > index 0000000000..ca97f451d8> >> > >> > --- /dev/null> >> > >> > +++ b/gnu/packages/aux-files/guix.vim> >> > >> > @@ -0,0 +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", $GUIX_ENVIRONMENT]> >> > >> > >> > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?> >> > >> This would allow users to keep a separate profile for Vim things.> >> > >> >> > > That was the one part I didn't really like about my patch. Unfortunately> >> > > I don't seem to have $GUIX_PROFILE set on my machine.> >> > >> >> > > (ins)efraim@E5400 ~$ echo $GUIX_PROFILE> >> > >> >> > > (ins)efraim@E5400 ~$> >> > > >> > Me neither! But when loading profiles we suggest this approach:> >> > > >> > export GUIX_PROFILE=/the/location/of/the/.guix-profile> >> > source $GUIX_PROFILE/etc/profile> >> > > >> > The variable is set in that case, because that affects whether absolute> >> > store file names are used or the symlink> >> > “/the/location/of/the/.guix-profile”.> >> > >> It seems to be the case for the default profile. And in Guix System. I> >> could also just add $GUIX_PROFILE as another location in the list of> >> directories to search.> >> > The more I think about it the more I see $HOME/.guix-profile as a> > "special profile" which is nearly always included in $PATH and other> > variables, similar to /run/current-system/profile. With that in mind I> > like the attached patch which keeps that path but adds a search for> > $GUIX_PROFILE.> >> > I could use environment variables to override vim's builtin search for> > $VIM and $VIMRUNTIME, but then we would have to decide to support vim> > installed by the user or system-wide.> > So vim only expects a single vimfiles directory in those variables?>
Not exactly. vim sets both $VIM and $VIMRUNTIME. $VIM points to$out/share/vim and $VIMRUNTIME points to $out/share/vim/vim82. In atypical FHS distro this would be /etc/share/vim and/etc/share/vim/vim82. Then any distro specific vimrc would be installedto /etc/share/vim/vimrc, which would also help load any distro installedplugins in /etc/share/vim/vimfiles. Any user installed plugins would be(typically) in ~/.vim/plugins/ with some extra directories formanagement or for the 'after' keyword to load last or 'opt' to only loadon command. Or in a 'pack' path to be activated with :packadd {plugin}.
Toggle quote (33 lines)> [...]> > > +++ b/gnu/packages/aux-files/guix.vim> > @@ -0,0 +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", $GUIX_PROFILE, $GUIX_ENVIRONMENT]> > + let vimplugins = directory . "/share/vim/vimfiles"> > + if isdirectory(vimplugins)> > + let &rtp = join([&rtp,vimplugins], ',')> > + endif> > +endfor> > I wonder if we could generalize this to a proper search path with> something like (pseudo code):> > for directory in getenv("VIM_PLUGIN_PATH").split(":")> let vimplugins = directory . "share/vim/vimfiles"> ...> > And then in the vim package:> > (native-search-paths> (list> (search-path-specification> (variable "VIM_PLUGIN_PATH")> (files '("share/vim/vimfiles")))))> > ...which makes Guix populate VIM_PLUGIN_PATH automatically as plugins> are added to a profile/environment (as long as it contains the 'vim'> package).> > WDYT?
I'll try putting something together like that. Rebuilding vim takesabout 3 minutes when I disable tests so it shouldn't be hard. I can alsoexperiment a bit with packpath and/or per-plugin paths inshare/vim/vimfiles/<package-name>.


-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9wUiwACgkQQarn3Mo9g1Hqaw/9HkE/lQCrzHMzMgr/bZUH9Ei/w9yGNpmEWjKpMfxy/h8jflmQenJ73ba9bj+w50BE+5SVTomsCBLz5I/Z5Mr4hZcBD+7yOq7eu87+2iV9GLhkWOGB6kvnGXv9lD4LjHEmaT4gEhX+plR+bHJVJzGVPh46O3SJM1o5F6WbMxJm80pST6GmgXW8d+DwOmWI1yzVfK7WMJYENDegMv0jgvhjmKHZJFQOUWNVXOZcAgRLiVk7RS4b6pm4dPVrmJEyWOKnNbqrjTG7NxXYWvkAnRVU1TVD6dKSBLYJABlGmaMXMR/8jfu72FbwBx43xztDt1/uOsyhmjqRoZ49aGa70fC9RuIWzIxooSlJhZNBhgajErAh4G+l92vVwF5PjBalFw0rh2nAepnc0w7Pt5sDfYcUcBqtzcQBKo5Ighz4E8zU1BoFQSV40dIaOsddDSB4al7jx4bC+MeicvvVSEhV3IzhaHYmYTK1dDyla2SToERv2QwHH7IEQTWvMlssebE8BAwo5Bi6ibJLoKe1WAXLrlJ3TlJMGuB5pXPnh6RLC9ipD+3ZPMJCtWEA8xNxxf5wt5nXX82P+Kmrkk7JdNxWn5SfxMBurJNOxUtDEWUpl238cnBES3WpaXdPzjbg+rJpBCelURqceIG7VJFelAmkO26A3khXlihWGbmJT28iUDjxB6A==dZNo-----END PGP SIGNATURE-----

E
E
Efraim Flashner wrote on 27 Sep 2020 11:41
(name . Marius Bakke)(address . marius@gnu.org)
20200927094125.GD1386@E5400
On Sun, Sep 27, 2020 at 11:49:51AM +0300, Efraim Flashner wrote:
Toggle quote (68 lines)> On Fri, Sep 25, 2020 at 07:48:34PM +0200, Marius Bakke wrote:> > Efraim Flashner <efraim@flashner.co.il> writes:> > > > > On Sun, Sep 20, 2020 at 11:57:58PM +0300, Efraim Flashner wrote:> > >> On Sun, Sep 20, 2020 at 09:50:12PM +0200, Ricardo Wurmus wrote:> > >> > > > >> > Efraim Flashner <efraim@flashner.co.il> writes:> > >> > > > >> > > On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:> > >> > >> > > >> > >> Efraim Flashner <efraim@flashner.co.il> writes:> > >> > >> > > >> > >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim> > >> > >> > new file mode 100644> > >> > >> > index 0000000000..ca97f451d8> > >> > >> > --- /dev/null> > >> > >> > +++ b/gnu/packages/aux-files/guix.vim> > >> > >> > @@ -0,0 +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", $GUIX_ENVIRONMENT]> > >> > >> > > >> > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?> > >> > >> This would allow users to keep a separate profile for Vim things.> > >> > >> > >> > > That was the one part I didn't really like about my patch. Unfortunately> > >> > > I don't seem to have $GUIX_PROFILE set on my machine.> > >> > >> > >> > > (ins)efraim@E5400 ~$ echo $GUIX_PROFILE> > >> > >> > >> > > (ins)efraim@E5400 ~$> > >> > > > >> > Me neither! But when loading profiles we suggest this approach:> > >> > > > >> > export GUIX_PROFILE=/the/location/of/the/.guix-profile> > >> > source $GUIX_PROFILE/etc/profile> > >> > > > >> > The variable is set in that case, because that affects whether absolute> > >> > store file names are used or the symlink> > >> > “/the/location/of/the/.guix-profile”.> > >> > > >> It seems to be the case for the default profile. And in Guix System. I> > >> could also just add $GUIX_PROFILE as another location in the list of> > >> directories to search.> > >> > > The more I think about it the more I see $HOME/.guix-profile as a> > > "special profile" which is nearly always included in $PATH and other> > > variables, similar to /run/current-system/profile. With that in mind I> > > like the attached patch which keeps that path but adds a search for> > > $GUIX_PROFILE.> > >> > > I could use environment variables to override vim's builtin search for> > > $VIM and $VIMRUNTIME, but then we would have to decide to support vim> > > installed by the user or system-wide.> > > > So vim only expects a single vimfiles directory in those variables?> > > > Not exactly. vim sets both $VIM and $VIMRUNTIME. $VIM points to> $out/share/vim and $VIMRUNTIME points to $out/share/vim/vim82. In a> typical FHS distro this would be /etc/share/vim and> /etc/share/vim/vim82. Then any distro specific vimrc would be installed> to /etc/share/vim/vimrc, which would also help load any distro installed> plugins in /etc/share/vim/vimfiles. Any user installed plugins would be> (typically) in ~/.vim/plugins/ with some extra directories for> management or for the 'after' keyword to load last or 'opt' to only load> on command. Or in a 'pack' path to be activated with :packadd {plugin}.>
... Actually replace all of these 'etc' with 'usr'.
Toggle quote (47 lines)> > [...]> > > > > +++ b/gnu/packages/aux-files/guix.vim> > > @@ -0,0 +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", $GUIX_PROFILE, $GUIX_ENVIRONMENT]> > > + let vimplugins = directory . "/share/vim/vimfiles"> > > + if isdirectory(vimplugins)> > > + let &rtp = join([&rtp,vimplugins], ',')> > > + endif> > > +endfor> > > > I wonder if we could generalize this to a proper search path with> > something like (pseudo code):> > > > for directory in getenv("VIM_PLUGIN_PATH").split(":")> > let vimplugins = directory . "share/vim/vimfiles"> > ...> > > > And then in the vim package:> > > > (native-search-paths> > (list> > (search-path-specification> > (variable "VIM_PLUGIN_PATH")> > (files '("share/vim/vimfiles")))))> > > > ...which makes Guix populate VIM_PLUGIN_PATH automatically as plugins> > are added to a profile/environment (as long as it contains the 'vim'> > package).> > > > WDYT?> > I'll try putting something together like that. Rebuilding vim takes> about 3 minutes when I disable tests so it shouldn't be hard. I can also> experiment a bit with packpath and/or per-plugin paths in> share/vim/vimfiles/<package-name>.> > > > -- > Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351> Confidentiality cannot be guaranteed on emails sent or received unencrypted


-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9wXkIACgkQQarn3Mo9g1HhcxAAvOy01Eb+9OEO6HaP2pkhXvpjXxPA6/bH/jfpS3mjdRfEGlqwlQnyPzItv/T2UGM7bS9G1xjY8t3IDOiSP+6zjNaERDI+D+lyjuV+SPWuJtEFr+Ji9nTMLNYhYRJTPXqNtKHYldVkp0tOVt/SMrmlRiDyN6ua1jNhcdQ6IaH4rfettHE479LTNM/J0ZzwFH1Y3nws0U36Q5InHSBvksjJQo8kNWpWFjPcrHjzeCJdcFtLiK3YV8cLtS0q6XeQdXn7qozkQDaWRrQn5mB1kCaekY6nQ6pDNvQ5WdUn+is6xrKvBWJ46hE68K6H3xZ26UjW/irIa7cBHh35C89HM87vDDRb22RRl9H5xNBYd8fGtjcSaIE4qq4FZqFKUKeJ9JxccTLEpw5iRsa8x24saKc7fs2CqNBSnFOlLMkyhS4vuwh6LU7iyRF1KMAW3fHlIPIpVIT+0KoZTS1x12zV06k0yx2gVcsFubFbo8AhnWEDWXIIVSCr0k7UPDK3e0n7BOt/vpaNuiShHWIB9aAib96MpWIm4ri051aP10mLmbf8TFmHfSAtb8FxJ2UnRGTKKVPj+OrEMUEQrsdpKPrZXVIgwTd3+9Cy4x2etd4RE1IguItsWVVtJc2uIkS9m3iO8ih2uzeTES6OWalt5vFTZnHByXS38cQnQgI2ZSz9zF7zkdY==5C8F-----END PGP SIGNATURE-----

E
E
Efraim Flashner wrote on 20 Dec 2020 12:10
(name . Marius Bakke)(address . marius@gnu.org)
X98xC8njiUjMZdhw@E5400
On Fri, Sep 25, 2020 at 07:48:34PM +0200, Marius Bakke wrote:
Toggle quote (74 lines)> Efraim Flashner <efraim@flashner.co.il> writes:> > > On Sun, Sep 20, 2020 at 11:57:58PM +0300, Efraim Flashner wrote:> >> On Sun, Sep 20, 2020 at 09:50:12PM +0200, Ricardo Wurmus wrote:> >> > > >> > Efraim Flashner <efraim@flashner.co.il> writes:> >> > > >> > > On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote:> >> > >> > >> > >> Efraim Flashner <efraim@flashner.co.il> writes:> >> > >> > >> > >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim> >> > >> > new file mode 100644> >> > >> > index 0000000000..ca97f451d8> >> > >> > --- /dev/null> >> > >> > +++ b/gnu/packages/aux-files/guix.vim> >> > >> > @@ -0,0 +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", $GUIX_ENVIRONMENT]> >> > >> > >> > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-profile?> >> > >> This would allow users to keep a separate profile for Vim things.> >> > >> >> > > That was the one part I didn't really like about my patch. Unfortunately> >> > > I don't seem to have $GUIX_PROFILE set on my machine.> >> > >> >> > > (ins)efraim@E5400 ~$ echo $GUIX_PROFILE> >> > >> >> > > (ins)efraim@E5400 ~$> >> > > >> > Me neither! But when loading profiles we suggest this approach:> >> > > >> > export GUIX_PROFILE=/the/location/of/the/.guix-profile> >> > source $GUIX_PROFILE/etc/profile> >> > > >> > The variable is set in that case, because that affects whether absolute> >> > store file names are used or the symlink> >> > “/the/location/of/the/.guix-profile”.> >> > >> It seems to be the case for the default profile. And in Guix System. I> >> could also just add $GUIX_PROFILE as another location in the list of> >> directories to search.> >> > The more I think about it the more I see $HOME/.guix-profile as a> > "special profile" which is nearly always included in $PATH and other> > variables, similar to /run/current-system/profile. With that in mind I> > like the attached patch which keeps that path but adds a search for> > $GUIX_PROFILE.> >> > I could use environment variables to override vim's builtin search for> > $VIM and $VIMRUNTIME, but then we would have to decide to support vim> > installed by the user or system-wide.> > So vim only expects a single vimfiles directory in those variables?> > [...]> > > +++ b/gnu/packages/aux-files/guix.vim> > @@ -0,0 +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", $GUIX_PROFILE, $GUIX_ENVIRONMENT]> > + let vimplugins = directory . "/share/vim/vimfiles"> > + if isdirectory(vimplugins)> > + let &rtp = join([&rtp,vimplugins], ',')> > + endif> > +endfor> > I wonder if we could generalize this to a proper search path with> something like (pseudo code):> > for directory in getenv("VIM_PLUGIN_PATH").split(":")> let vimplugins = directory . "share/vim/vimfiles"> ...
Note for the future, 'let vimplugins = directory' is what works here.
Toggle quote (15 lines)> > And then in the vim package:> > (native-search-paths> (list> (search-path-specification> (variable "VIM_PLUGIN_PATH")> (files '("share/vim/vimfiles")))))> > ...which makes Guix populate VIM_PLUGIN_PATH automatically as plugins> are added to a profile/environment (as long as it contains the 'vim'> package).> > WDYT?
I wasn't able to get anything like that to work. For some reason theonly combination I got using VIM_PLUGIN_PATH to work was aguix-environment with vim and a plugin in it.
I pushed the version with the hardcoded list of directories since I wasable to actually get that one to work.
-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl/fMQcACgkQQarn3Mo9g1FHZg//W7VKyVPqWiX4Sw3pO3RQG6wsLRMNgWSvApku0sJh8u/NTZ0UJ9EB1v0rZq9Pg8Xx9PP9ctKYyDmwTIK8m/adu0VWNSVoIAccH5XiKHeieE1KUOYOpJ6o8jHv89h87TBpjv+hTKoHdbkoHNPFJKL/h3Ow4MAKSwsMXQ1cpc4SVhXlfp2tq+cfBTTIFK3AhmwbpQ7nWGv/miJrHXtbYLfGinefxGiTUWwM9E3RoNioF7sE7knDc3WYjKWGBIlLB/WnBgl8VA7MUjISg21cjK3M15WCOOpvQMjzC8BjiCbkPfzeDz/fOOxyMyqP7bYXiA2Roplx0hbGdRmdyDDLhY6IpcVmQGBhffQ4gxUl6y0Oh1GAgB6VdSYZKMXdUN2g601MU5bzOX9KOx299od87FSCRva+eNL5WWutnrE/U88Uam8WYzWaScor/+0qCE0lyeKbpXRleKNLz4MU+gHuukaN2pllq9zfw9cOlSogYjuLLspu+GuUwIGZ0V1LbDkUlMFbd3I4+AyEIoLDVzBM6qowejsNbkFM7eXcaTn4qV6iBp2NBVJON82pB/Xkov3V2W0UkJeOmea9vwFGvolc8biayHKkMXFV08SUDUPlCRmsT/DVnzySDk15jyFnYZfWqbqO+p/QS1nM2PO0EYpHtZ+fDPPIFo35tl7QKOJd71C2Tgk==7Ge7-----END PGP SIGNATURE-----

Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 43539@debbugs.gnu.org