Skip to content

Commit 14256e4

Browse files
committed
Merge remote-tracking branch 'lenormf/rc/man.kak'
2 parents 6ce6b1b + 7dbbdca commit 14256e4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

rc/core/man.kak

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ decl str docsclient
22

33
hook global WinSetOption filetype=man %{
44
addhl group man-highlight
5+
# Sections
56
addhl -group man-highlight regex ^\S.*?$ 0:blue
6-
addhl -group man-highlight regex ^\h+-+[-a-zA-Z_]+ 0:yellow
7-
addhl -group man-highlight regex [-a-zA-Z_.]+\(\d\) 0:green
8-
hook window -group man-hooks NormalKey <c-m> man
9-
set buffer tabstop 8
7+
# Subsections
8+
addhl -group man-highlight regex '^ {3}\S.*?$' 0:default+b
9+
# Command line options
10+
addhl -group man-highlight regex '^ {7}-[^\s,]+(,\s+-[^\s,]+)*' 0:yellow
11+
# References to other manpages
12+
addhl -group man-highlight regex [-a-zA-Z0-9_.]+\(\d\) 0:green
1013
}
1114

1215
hook global WinSetOption filetype=(?!man).* %{
@@ -19,7 +22,7 @@ def -hidden -params .. _man %{ %sh{
1922
colout=$(mktemp /tmp/kak-man-XXXXXX)
2023
MANWIDTH=${kak_window_width} man "$@" > $manout
2124
retval=$?
22-
col -b > ${colout} < ${manout}
25+
col -b -x > ${colout} < ${manout}
2326
rm ${manout}
2427
if [ "${retval}" -eq 0 ]; then
2528
echo "edit! -scratch '*man*'

0 commit comments

Comments
 (0)