From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtprelay04.ispgateway.de ([80.67.31.38]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1RouGH-0004SE-9e for ptxdist@pengutronix.de; Sun, 22 Jan 2012 11:03:19 +0100 Received: from [88.217.113.105] (helo=galilei.fritz.box) by smtprelay04.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1RouGG-0003UX-R4 for ptxdist@pengutronix.de; Sun, 22 Jan 2012 11:02:56 +0100 From: Bernhard Walle Date: Sun, 22 Jan 2012 11:02:50 +0100 Message-Id: <1327226570-56260-1-git-send-email-bernhard@bwalle.de> In-Reply-To: <20120122093432.GB12400@pengutronix.de> References: <20120122093432.GB12400@pengutronix.de> Subject: [ptxdist] [PATCH] Setup vim folding in the logfile automatically Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de This patch adds the modeline # vim: set fdm=marker fdl=1: to the Logfile. There's already a modeline for Emacs in the file, so it shouldn't be too annoying for users that don't use vim. The first setting tells vim to recognize the fold markers '{{{' and '}}}' in the logfile (which doesn't have any file type in vim). However, with this setting vim automatically closes all folds, including the first '{{{' which only is for Emacs. That's why I add fdl=1, which results in vim opening the file visible one fold per ptxdist run. Signed-off-by: Bernhard Walle --- v2: Use marker, not markers. bin/ptxdist | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/bin/ptxdist b/bin/ptxdist index 73235c4..74a52ad 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -2270,6 +2270,9 @@ setup_logfile() if [ \! -e "${PTX_LOGFILE}" ]; then # let emacs outline mode be compatible to vi's fold mode echo -e "# -*- mode:outline; outline-regexp:\"{""{{\" -*-\n" > "${PTX_LOGFILE}" + # help vim to recognise the fold markers and expand the first level of folding + # which in fact is the Emacs setting above + echo "# vim: set fdm=marker fdl=1:" > "${PTX_LOGFILE}" fi # -- 1.7.7.4 -- ptxdist mailing list ptxdist@pengutronix.de