1
1
" Vim syntax script
2
2
" Author: Peter Odding <peter@peterodding.com>
3
- " Last Change: June 4 , 2011
3
+ " Last Change: June 24 , 2011
4
4
" URL: http://peterodding.com/code/vim/notes/
5
5
6
6
" Note: This file is encoded in UTF-8 including a byte order mark so
@@ -28,7 +28,7 @@ syntax cluster notesInline add=notesName
28
28
highlight def link notesName Underlined
29
29
30
30
" Highlight @tags as hyperlinks. {{{2
31
- syntax match notesTagName / \( ^\|\s\)\@ <=@\w \+ /
31
+ syntax match notesTagName / \( ^\|\s\)\@ <=@\k \+ /
32
32
highlight def link notesTagName Underlined
33
33
34
34
" Highlight list bullets and numbers. {{{2
@@ -47,26 +47,29 @@ highlight def link notesQuotedFragment Special
47
47
48
48
" Highlight text emphasized in italic font. {{{2
49
49
if has (' conceal' )
50
- syntax region notesItalic matchgroup =notesItalicMarker start =/ \< _[A-Za-z] \@ =/ end =/ _\>\|\n / contains =@Spell concealends
50
+ syntax region notesItalic matchgroup =notesItalicMarker start =/ \< _\k \@ =/ end =/ _\>\|\n / contains =@Spell concealends
51
51
highlight link notesItalicMarker notesHiddenMarker
52
52
else
53
- syntax match notesItalic / \< _\w [^_]*\w _ \> /
53
+ syntax match notesItalic / \< _\k [^_]*\k _ \> /
54
54
endif
55
55
syntax cluster notesInline add =notesItalic
56
56
highlight notesItalic gui = italic
57
57
58
58
" Highlight text emphasized in bold font. {{{2
59
59
if has (' conceal' )
60
- syntax region notesBold matchgroup =notesBoldMarker start =/ \*\w \@ =/ end =/ \w \@ <=\* / contains =@Spell concealends
60
+ syntax region notesBold matchgroup =notesBoldMarker start =/ \*\k \@ =/ end =/ \k \@ <=\* / contains =@Spell concealends
61
61
highlight link notesBoldMarker notesHiddenMarker
62
62
else
63
- syntax match notesBold / \*\w [^*]*\w \* /
63
+ syntax match notesBold / \*\k [^*]*\k \* /
64
64
endif
65
65
syntax cluster notesInline add =notesBold
66
66
highlight notesBold gui = bold
67
67
68
68
" Highlight domain names, URLs, e-mail addresses and filenames. {{{2
69
+
70
+ " FIXME This setting is lost once the user switches color scheme!
69
71
highlight notesSubtleURL gui = underline guifg= fg
72
+
70
73
syntax match notesTextURL @ \< www\.\(\S *\w\)\+ /\? @
71
74
syntax cluster notesInline add =notesTextURL
72
75
highlight def link notesTextURL notesSubtleURL
@@ -80,12 +83,12 @@ endif
80
83
syntax match notesEmailAddr / \<\w [^@ \t\r ]*\w @\w [^@ \t\r ]\+\w\> /
81
84
syntax cluster notesInline add =notesEmailAddr
82
85
highlight def link notesEmailAddr notesSubtleURL
83
- syntax match notesUnixPath / \w \@ <![\/ ~]\S\+\(\/\| [^ [:punct:]]\) / contains = notesName | " <- UNIX style pathnames
86
+ syntax match notesUnixPath / \k \@ <![\/ ~]\S\+\(\/\| [^ [:punct:]]\) /
84
87
syntax cluster notesInline add =notesUnixPath
85
88
highlight def link notesUnixPath Directory
86
89
syntax match notesPathLnum / :\d\+ / contained containedin =notesUnixPath
87
90
highlight def link notesPathLnum Comment
88
- syntax match notesWindowsPath / \w \@ <![A-Za-z]:\S\+\( [\\ /]\| [^ [:punct:]]\) / contains = notesName | " <- Windows style pathnames
91
+ syntax match notesWindowsPath / \k \@ <![A-Za-z]:\S\+\( [\\ /]\| [^ [:punct:]]\) /
89
92
syntax cluster notesInline add =notesWindowsPath
90
93
highlight def link notesWindowsPath Directory
91
94
@@ -113,7 +116,7 @@ syntax match notesTitle /^.*\%1l.*$/ contains=@notesInline
113
116
highlight def link notesTitle ModeMsg
114
117
115
118
" Short sentences ending in a colon are considered headings. {{{2
116
- syntax match notesShortHeading / ^\s *\z s\u .\{ 1,50}\w :\z e\(\s\| $\) / contains =@notesInline
119
+ syntax match notesShortHeading / ^\s *\z s\u .\{ 1,50}\k :\z e\(\s\| $\) / contains =@notesInline
117
120
highlight def link notesShortHeading Title
118
121
119
122
" Atx style headings are also supported. {{{2
0 commit comments