From 7dbbdca953aa2d4568a9113fa80c6626d39578b8 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Tue, 2 Feb 2016 08:16:23 +0200 Subject: [PATCH] Get rid of tabs in the man pages to simplify highlighting, improve and document highlighting, get rid of the arbitrary binding --- rc/man.kak | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rc/man.kak b/rc/man.kak index c1ef62e8..27dae843 100644 --- a/rc/man.kak +++ b/rc/man.kak @@ -2,11 +2,14 @@ decl str docsclient hook global WinSetOption filetype=man %{ addhl group man-highlight + # Sections addhl -group man-highlight regex ^\S.*?$ 0:blue - addhl -group man-highlight regex ^\h+-+[-a-zA-Z_]+ 0:yellow - addhl -group man-highlight regex [-a-zA-Z_.]+\(\d\) 0:green - hook window -group man-hooks NormalKey man - set buffer tabstop 8 + # Subsections + addhl -group man-highlight regex '^ {3}\S.*?$' 0:default+b + # Command line options + addhl -group man-highlight regex '^ {7}-[^\s,]+(,\s+-[^\s,]+)*' 0:yellow + # References to other manpages + addhl -group man-highlight regex [-a-zA-Z0-9_.]+\(\d\) 0:green } hook global WinSetOption filetype=(?!man).* %{ @@ -19,7 +22,7 @@ def -hidden -params .. _man %{ %sh{ colout=$(mktemp /tmp/kak-man-XXXXXX) MANWIDTH=${kak_window_width} man "$@" > $manout retval=$? - col -b > ${colout} < ${manout} + col -b -x > ${colout} < ${manout} rm ${manout} if [ "${retval}" -eq 0 ]; then echo "edit! -scratch '*man*'