From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YOsrH1Ex31/POQAA0tVLHw (envelope-from ) for ; Sun, 20 Dec 2020 11:11:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id WMHpGlEx31/aAQAAbx9fmQ (envelope-from ) for ; Sun, 20 Dec 2020 11:11:13 +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 924719404D2 for ; Sun, 20 Dec 2020 11:11:12 +0000 (UTC) Received: from localhost ([::1]:37068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqwcJ-0002bU-7Y for larch@yhetil.org; Sun, 20 Dec 2020 06:11:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqwcA-0002ZI-4z for guix-patches@gnu.org; Sun, 20 Dec 2020 06:11:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqwc9-0006DZ-Te for guix-patches@gnu.org; Sun, 20 Dec 2020 06:11:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqwc9-00070i-P9 for guix-patches@gnu.org; Sun, 20 Dec 2020 06:11:01 -0500 Subject: bug#43539: [PATCH] gnu: vim: Automatically find vim plugins. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Sun, 20 Dec 2020 11:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 43539 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Marius Bakke Mail-Followup-To: 43539@debbugs.gnu.org, efraim@flashner.co.il, efraim@flashner.co.il Received: via spool by 43539-done@debbugs.gnu.org id=D43539.160846261926887 (code D ref 43539); Sun, 20 Dec 2020 11:11:01 +0000 Received: (at 43539-done) by debbugs.gnu.org; 20 Dec 2020 11:10:19 +0000 Received: from localhost ([127.0.0.1]:43784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqwbT-0006za-10 for submit@debbugs.gnu.org; Sun, 20 Dec 2020 06:10:19 -0500 Received: from flashner.co.il ([178.62.234.194]:48104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqwbR-0006zK-3F for 43539-done@debbugs.gnu.org; Sun, 20 Dec 2020 06:10:17 -0500 Received: from localhost (unknown [5.102.238.249]) by flashner.co.il (Postfix) with ESMTPSA id 04236402D2; Sun, 20 Dec 2020 11:10:10 +0000 (UTC) Date: Sun, 20 Dec 2020 13:10:03 +0200 From: Efraim Flashner Message-ID: 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> <87o8lt4uj1.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Fhp4Vl41Sc5qFcdy" Content-Disposition: inline In-Reply-To: <87o8lt4uj1.fsf@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43539-done@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.91 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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-Migadu-Queue-Id: 924719404D2 X-Spam-Score: -3.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: ol7MPAr0aZvl --Fhp4Vl41Sc5qFcdy Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 25, 2020 at 07:48:34PM +0200, Marius Bakke wrote: > Efraim Flashner writes: >=20 > > 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= -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 runt= imepath. > >> > >> > +for directory in ["/run/current-system/profile", $HOME . "/.gu= ix-profile", $GUIX_ENVIRONMENT] > >> > >>=20 > >> > >> How about using $GUIX_PROFILE as well or instead of $HOME/.guix-p= rofile? > >> > >> 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. Unfortu= nately > >> > > 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 absol= ute > >> > 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. >=20 > So vim only expects a single vimfiles directory in those variables? >=20 > [...] >=20 > > +++ 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-profi= le", $GUIX_PROFILE, $GUIX_ENVIRONMENT] > > + let vimplugins =3D directory . "/share/vim/vimfiles" > > + if isdirectory(vimplugins) > > + let &rtp =3D join([&rtp,vimplugins], ',') > > + endif > > +endfor >=20 > I wonder if we could generalize this to a proper search path with > something like (pseudo code): >=20 > for directory in getenv("VIM_PLUGIN_PATH").split(":") > let vimplugins =3D directory . "share/vim/vimfiles" > ... Note for the future, 'let vimplugins =3D directory' is what works here. >=20 > And then in the vim package: >=20 > (native-search-paths > (list > (search-path-specification > (variable "VIM_PLUGIN_PATH") > (files '("share/vim/vimfiles"))))) >=20 > ...which makes Guix populate VIM_PLUGIN_PATH automatically as plugins > are added to a profile/environment (as long as it contains the 'vim' > package). >=20 > WDYT? I wasn't able to get anything like that to work. For some reason the only combination I got using VIM_PLUGIN_PATH to work was a guix-environment with vim and a plugin in it. I pushed the version with the hardcoded list of directories since I was able to actually get that one to work. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --Fhp4Vl41Sc5qFcdy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl/fMQcACgkQQarn3Mo9 g1FHZg//W7VKyVPqWiX4Sw3pO3RQG6wsLRMNgWSvApku0sJh8u/NTZ0UJ9EB1v0r Zq9Pg8Xx9PP9ctKYyDmwTIK8m/adu0VWNSVoIAccH5XiKHeieE1KUOYOpJ6o8jHv 89h87TBpjv+hTKoHdbkoHNPFJKL/h3Ow4MAKSwsMXQ1cpc4SVhXlfp2tq+cfBTTI FK3AhmwbpQ7nWGv/miJrHXtbYLfGinefxGiTUWwM9E3RoNioF7sE7knDc3WYjKWG BIlLB/WnBgl8VA7MUjISg21cjK3M15WCOOpvQMjzC8BjiCbkPfzeDz/fOOxyMyqP 7bYXiA2Roplx0hbGdRmdyDDLhY6IpcVmQGBhffQ4gxUl6y0Oh1GAgB6VdSYZKMXd UN2g601MU5bzOX9KOx299od87FSCRva+eNL5WWutnrE/U88Uam8WYzWaScor/+0q CE0lyeKbpXRleKNLz4MU+gHuukaN2pllq9zfw9cOlSogYjuLLspu+GuUwIGZ0V1L bDkUlMFbd3I4+AyEIoLDVzBM6qowejsNbkFM7eXcaTn4qV6iBp2NBVJON82pB/Xk ov3V2W0UkJeOmea9vwFGvolc8biayHKkMXFV08SUDUPlCRmsT/DVnzySDk15jyFn YZfWqbqO+p/QS1nM2PO0EYpHtZ+fDPPIFo35tl7QKOJd71C2Tgk= =7Ge7 -----END PGP SIGNATURE----- --Fhp4Vl41Sc5qFcdy--