From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cH/VJhrHaV/ZLgAA0tVLHw (envelope-from ) for ; Tue, 22 Sep 2020 09:42:50 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id NbqZIhrHaV+kGwAAB5/wlQ (envelope-from ) for ; Tue, 22 Sep 2020 09:42:50 +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 B1A40940291 for ; Tue, 22 Sep 2020 09:42:49 +0000 (UTC) Received: from localhost ([::1]:39290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKeoy-0008Rc-B5 for larch@yhetil.org; Tue, 22 Sep 2020 05:42:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKelK-0004dT-7F for guix-patches@gnu.org; Tue, 22 Sep 2020 05:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKelJ-0007oA-SV for guix-patches@gnu.org; Tue, 22 Sep 2020 05:39:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKelJ-0004Mj-PP for guix-patches@gnu.org; Tue, 22 Sep 2020 05:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43539] [PATCH] gnu: vim: Automatically find vim plugins. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Sep 2020 09:39: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: Ricardo Wurmus Cc: 43539@debbugs.gnu.org Received: via spool by 43539-submit@debbugs.gnu.org id=B43539.160076749616722 (code B ref 43539); Tue, 22 Sep 2020 09:39:01 +0000 Received: (at 43539) by debbugs.gnu.org; 22 Sep 2020 09:38:16 +0000 Received: from localhost ([127.0.0.1]:57249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKeka-0004Ld-C9 for submit@debbugs.gnu.org; Tue, 22 Sep 2020 05:38:16 -0400 Received: from flashner.co.il ([178.62.234.194]:49158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKekX-0004LP-W3 for 43539@debbugs.gnu.org; Tue, 22 Sep 2020 05:38:14 -0400 Received: from localhost (unknown [31.210.181.177]) by flashner.co.il (Postfix) with ESMTPSA id 652A940037; Tue, 22 Sep 2020 09:38:07 +0000 (UTC) Date: Tue, 22 Sep 2020 12:37:34 +0300 From: Efraim Flashner Message-ID: <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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mhjHhnbe5PrRcwjY" Content-Disposition: inline In-Reply-To: <20200920205758.GD6984@E5400> 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-Spam-Score: 1.2 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: 0.2 (/) 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=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-Spam-Score: 0.69 X-TUID: qappav2NbGmJ --mhjHhnbe5PrRcwjY Content-Type: multipart/mixed; boundary="EDJsL2R9iCFAt7IV" Content-Disposition: inline --EDJsL2R9iCFAt7IV Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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-fi= les/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 runtime= path. > > >> > +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-prof= ile? > > >> 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. Unfortunat= ely > > > 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. --=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 --EDJsL2R9iCFAt7IV Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-vim-Automatically-find-vim-plugins.patch" Content-Transfer-Encoding: quoted-printable =46rom 89a465c32a1d75a473cb643c49bbf65c093b1d4e Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner Date: Fri, 18 Sep 2020 18:25:06 +0300 Subject: [PATCH] gnu: vim: Automatically find vim plugins. * gnu/packages/vim.scm (vim)[arguments]: Add new 'install-guix.vim phase to 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 diff --git a/Makefile.am b/Makefile.am index 8e91e1e558..d0867ecd22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -332,6 +332,7 @@ dist_noinst_DATA =3D \ AUX_FILES =3D \ 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.= vim new file mode 100644 index 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 =3D directory . "/share/vim/vimfiles" + if isdirectory(vimplugins) + let &rtp =3D join([&rtp,vimplugins], ',') + endif +endfor diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm index 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") "/shar= e/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")) =20 ;; For tests. ("tzdata" ,tzdata-for-tests))) --=20 2.28.0 --EDJsL2R9iCFAt7IV-- --mhjHhnbe5PrRcwjY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9pxd4ACgkQQarn3Mo9 g1FpTxAAj7OTWGpC8E02ZUn9b6CysQhTG3+WRYH6edLKGR/Ry0hevWR/qJT7j421 yJbEhfiRsX/5obfoV+YC1Zmh3sp/Nc/qEM1RW3+2ONiPrpvFHUMSjI5WYqXTsiNK ncpUsSeFmfGc+vMbiWG0NxRm4oGsrbLTvHcjdv3SZoxRyq0w0OsLx+s1dupknuzF bY8PJQH1fdKYJsHuSS8GVsnkn72kqTWfnp+YFGC5iTAmoUvrRpT0om97Dzy0U0Oq hCowNwuheB3HotgmJLmmU2AWwsYJhOwhB4VDChwnDfh6iGB/6ayRMhnzmFpUb0wh Kk2qLNBWGQVefoKeynCCwBjHFKRO+YgvojE11+WcZsOt2yS5HGRal6S5gWxjnoJ6 F4tWeVnXDOs/ClgCla4oG3kAkBuWKzvz6qS2qILlseZuMSnbSXe3OoKrxDlZR/xz 4f91OEove5SHL4V6ZBIDxQQ61a+4GfFld/DvqcA3/NmBnhexdwkPZubZJ2Fnnc7J hnQ7zR0tOylvShroAKNpQRwoE0P3w8rjFqLWuaf6WB+UdckoUOhSC1xOeNqXyNIg vtNKrkjn3ui0M+bW2nIqc3EKJeDaLi/Wn+eVjqxCURtmFjcxVCc8DjtEyHkBTbJw gjZNzseRAejmfYRP5zwuPkvEx1h+wfJaw+JQnKUVWQUlZr7FUL0= =peO0 -----END PGP SIGNATURE----- --mhjHhnbe5PrRcwjY--