From patchwork Sun Sep 20 19:15:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 24237 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1D6B727BBE7; Sun, 20 Sep 2020 20:17:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8C52027BBE8 for ; Sun, 20 Sep 2020 20:17:08 +0100 (BST) Received: from localhost ([::1]:60862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK4pf-0007IO-HA for patchwork@mira.cbaines.net; Sun, 20 Sep 2020 15:17:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK4pa-0007II-Bq for guix-patches@gnu.org; Sun, 20 Sep 2020 15:17:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41115) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kK4pa-0003ku-1M for guix-patches@gnu.org; Sun, 20 Sep 2020 15:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kK4pZ-0005NK-Rk for guix-patches@gnu.org; Sun, 20 Sep 2020 15:17: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: Sun, 20 Sep 2020 19:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43539 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43539@debbugs.gnu.org Cc: Efraim Flashner X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160062939520624 (code B ref -1); Sun, 20 Sep 2020 19:17:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Sep 2020 19:16:35 +0000 Received: from localhost ([127.0.0.1]:52661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kK4p8-0005Ma-Qr for submit@debbugs.gnu.org; Sun, 20 Sep 2020 15:16:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:55488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kK4p6-0005MR-Lq for submit@debbugs.gnu.org; Sun, 20 Sep 2020 15:16:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK4p6-0007F0-Fa for guix-patches@gnu.org; Sun, 20 Sep 2020 15:16:32 -0400 Received: from flashner.co.il ([178.62.234.194]:42004) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK4p4-0003e1-Gv for guix-patches@gnu.org; Sun, 20 Sep 2020 15:16:32 -0400 Received: from localhost (unknown [31.210.181.177]) by flashner.co.il (Postfix) with ESMTPSA id 63719400B1; Sun, 20 Sep 2020 19:15:57 +0000 (UTC) From: Efraim Flashner Date: Sun, 20 Sep 2020 22:15:23 +0300 Message-Id: <20200920191523.6871-1-efraim@flashner.co.il> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/20 15:15:57 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 = \ 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.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] + let testpath = directory . "/share/vim/vimfiles" + if isdirectory(testpath) + let &rtp = join([&rtp,testpath], ',') + 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") "/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)))