Skip to content

Commit 10e38c7

Browse files
committed
add support for sh/bash/ksh
1 parent d2ccb37 commit 10e38c7

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

after/syntax/sh.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
syn match shCommentColor contained '\(#[^#]*\)\@<=\zs#\x\{3}\%(\x\{3}\)\?\>' containedin=shQuickComment,shBQComment,shComment
2+
call css_color#init( 'hex', 'none'
3+
\, 'shSingleQuote,shDoubleQuote,shHereDoc,'
4+
\. 'shTestSingleQuote,shTestDoubleQuote,'
5+
\. 'shEchoQuote,shEmbeddedEcho,shEcho,'
6+
\. 'shCommentColor' )

tests/example.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# XXX #0f0 should show up green
2+
# XXX f00 should not show up red
3+
# FIXME ff0 should show up yellow but are known not to
4+
5+
echo '#0f0'
6+
echo ##0f0
7+
echo \#ff0
8+
echo #f00
9+
echo ##0f0
10+
echo # #0f0
11+
cmd '#0f0'
12+
cmd "#0f0"
13+
cmd \#ff0
14+
cmd #f00
15+
cmd ##0f0
16+
cmd # #0f0
17+
echo `foo # #0f0`
18+
for (( x = '#0f0' )) ; do : ; done
19+
for (( x = "#0f0" )) ; do : ; done
20+
#f00
21+
##0f0 XXX
22+
# #0f0 XXX
23+
# XXX #0f0 XXX
24+
cat << ''
25+
#0f0
26+

0 commit comments

Comments
 (0)