summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Walle <bernhard@bwalle.de>2012-01-22 11:02:50 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-01-23 23:16:09 +0100
commit42b2d19be00bf0024fb7301ceae165f42df57969 (patch)
treef118528f20643f10a936e5501f89134961e158f0
parentf3f58cb4d3cfe67602db050839f540af75ea18df (diff)
downloadptxdist-42b2d19be00bf0024fb7301ceae165f42df57969.tar.gz
ptxdist-42b2d19be00bf0024fb7301ceae165f42df57969.tar.xz
Setup vim folding in the logfile automatically
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> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xbin/ptxdist3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index 73235c4f6..74a52adac 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
#