mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Bernhard Walle <bernhard@bwalle.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] Setup vim folding in the logfile automatically
Date: Sun, 22 Jan 2012 11:02:50 +0100	[thread overview]
Message-ID: <1327226570-56260-1-git-send-email-bernhard@bwalle.de> (raw)
In-Reply-To: <20120122093432.GB12400@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 <bernhard@bwalle.de>
---
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

      reply	other threads:[~2012-01-22 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22  9:12 Bernhard Walle
2012-01-22  9:34 ` Michael Olbrich
2012-01-22 10:02   ` Bernhard Walle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327226570-56260-1-git-send-email-bernhard@bwalle.de \
    --to=bernhard@bwalle.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox