From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CJcZLpYtbl9CBgAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 17:49:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OHr2KZYtbl/jdgAA1q6Kng (envelope-from ) for ; Fri, 25 Sep 2020 17:49:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F15FF94060E for ; Fri, 25 Sep 2020 17:49:09 +0000 (UTC) Received: from localhost ([::1]:60380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLrqG-0002vJ-Ch for larch@yhetil.org; Fri, 25 Sep 2020 13:49:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLrqA-0002v2-1b for guix-patches@gnu.org; Fri, 25 Sep 2020 13:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33710) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLrq9-0001Mr-KD for guix-patches@gnu.org; Fri, 25 Sep 2020 13:49:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLrq9-0005EN-ID for guix-patches@gnu.org; Fri, 25 Sep 2020 13:49:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43539] [PATCH] gnu: vim: Automatically find vim plugins. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Sep 2020 17:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43539 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner , Ricardo Wurmus Cc: 43539@debbugs.gnu.org Received: via spool by 43539-submit@debbugs.gnu.org id=B43539.160105612620085 (code B ref 43539); Fri, 25 Sep 2020 17:49:01 +0000 Received: (at 43539) by debbugs.gnu.org; 25 Sep 2020 17:48:46 +0000 Received: from localhost ([127.0.0.1]:45256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLrpt-0005Ds-Ju for submit@debbugs.gnu.org; Fri, 25 Sep 2020 13:48:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLrpq-0005Dg-Vv for 43539@debbugs.gnu.org; Fri, 25 Sep 2020 13:48:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42108) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLrpk-0001Kt-V7; Fri, 25 Sep 2020 13:48:36 -0400 Received: from [80.232.114.98] (port=59722 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kLrpk-0008WL-Ga; Fri, 25 Sep 2020 13:48:36 -0400 From: Marius Bakke In-Reply-To: <20200922093734.GF1007@E5400> References: <20200920191523.6871-1-efraim@flashner.co.il> <87bli0tffs.fsf@elephly.net> <20200920193215.GA6984@E5400> <875z88teh7.fsf@elephly.net> <20200920205758.GD6984@E5400> <20200922093734.GF1007@E5400> Date: Fri, 25 Sep 2020 19:48:34 +0200 Message-ID: <87o8lt4uj1.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -3.61 X-TUID: 1yjPfiwfqoMc --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Efraim Flashner 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: >> >=20 >> > Efraim Flashner writes: >> >=20 >> > > On Sun, Sep 20, 2020 at 09:29:27PM +0200, Ricardo Wurmus wrote: >> > >>=20 >> > >> Efraim Flashner writes: >> > >>=20 >> > >> > diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-f= iles/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 runtim= epath. >> > >> > +for directory in ["/run/current-system/profile", $HOME . "/.guix= -profile", $GUIX_ENVIRONMENT] >> > >>=20 >> > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-pro= file? >> > >> 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. Unfortuna= tely >> > > I don't seem to have $GUIX_PROFILE set on my machine. >> > > >> > > (ins)efraim@E5400 ~$ echo $GUIX_PROFILE >> > > >> > > (ins)efraim@E5400 ~$ >> >=20 >> > Me neither! But when loading profiles we suggest this approach: >> >=20 >> > export GUIX_PROFILE=3D/the/location/of/the/.guix-profile >> > source $GUIX_PROFILE/etc/profile >> >=20 >> > The variable is set in that case, because that affects whether absolute >> > store file names are used or the symlink >> > =E2=80=9C/the/location/of/the/.guix-profile=E2=80=9D. >>=20 >> 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 =3D directory . "/share/vim/vimfiles" > + if isdirectory(vimplugins) > + let &rtp =3D 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 =3D 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? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl9uLXIACgkQoqBt8qM6 VPqW4Qf/efuJfE46Cnzkbp83/17JqH9PlABcsPT0+nOYQg3weDiIClx+8NxA1Fe4 T2Kd48jAkFGIRn/z95dZB7eCH3rPNIcIWyoNKIbn6kerR49hVZiCleucC/JnC4fn ZaXDwqYzhkYWHXgfmbrussfbpb21G3ZMlnZEaAV+pvqF+Ag84+mZCLELW2ygzq79 alWMgaBal7Nl4qFjC15gGK+4/oLB80RAXIvTO1Th3p+X1uA+Xxk6lfaMR6OQBq06 rKmqymADA+T47dJGnJwNH0L6t9a6uC24Ze8C2m1Y0rN9ys7KGVF9t7UuvcEveu4H Jv78ocRuMM641OByW1IAKXe4x9eSyQ== =rlr8 -----END PGP SIGNATURE----- --=-=-=--