11" Vim syntax script
22" Author: Peter Odding <peter@peterodding.com>
3- " Last Change: June 4 , 2011
3+ " Last Change: June 24 , 2011
44" URL: http://peterodding.com/code/vim/notes/
55
66" Note: This file is encoded in UTF-8 including a byte order mark so
@@ -28,7 +28,7 @@ syntax cluster notesInline add=notesName
2828highlight def link notesName Underlined
2929
3030" Highlight @tags as hyperlinks. {{{2
31- syntax match notesTagName / \( ^\|\s\)\@ <=@\w \+ /
31+ syntax match notesTagName / \( ^\|\s\)\@ <=@\k \+ /
3232highlight def link notesTagName Underlined
3333
3434" Highlight list bullets and numbers. {{{2
@@ -47,26 +47,29 @@ highlight def link notesQuotedFragment Special
4747
4848" Highlight text emphasized in italic font. {{{2
4949if 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
5151 highlight link notesItalicMarker notesHiddenMarker
5252else
53- syntax match notesItalic / \< _\w [^_]*\w _ \> /
53+ syntax match notesItalic / \< _\k [^_]*\k _ \> /
5454endif
5555syntax cluster notesInline add =notesItalic
5656highlight notesItalic gui = italic
5757
5858" Highlight text emphasized in bold font. {{{2
5959if 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
6161 highlight link notesBoldMarker notesHiddenMarker
6262else
63- syntax match notesBold / \*\w [^*]*\w \* /
63+ syntax match notesBold / \*\k [^*]*\k \* /
6464endif
6565syntax cluster notesInline add =notesBold
6666highlight notesBold gui = bold
6767
6868" Highlight domain names, URLs, e-mail addresses and filenames. {{{2
69+
70+ " FIXME This setting is lost once the user switches color scheme!
6971highlight notesSubtleURL gui = underline guifg= fg
72+
7073syntax match notesTextURL @ \< www\.\(\S *\w\)\+ /\? @
7174syntax cluster notesInline add =notesTextURL
7275highlight def link notesTextURL notesSubtleURL
@@ -80,12 +83,12 @@ endif
8083syntax match notesEmailAddr / \<\w [^@ \t\r ]*\w @\w [^@ \t\r ]\+\w\> /
8184syntax cluster notesInline add =notesEmailAddr
8285highlight def link notesEmailAddr notesSubtleURL
83- syntax match notesUnixPath / \w \@ <![\/ ~]\S\+\(\/\| [^ [:punct:]]\) / contains = notesName | " <- UNIX style pathnames
86+ syntax match notesUnixPath / \k \@ <![\/ ~]\S\+\(\/\| [^ [:punct:]]\) /
8487syntax cluster notesInline add =notesUnixPath
8588highlight def link notesUnixPath Directory
8689syntax match notesPathLnum / :\d\+ / contained containedin =notesUnixPath
8790highlight 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:]]\) /
8992syntax cluster notesInline add =notesWindowsPath
9093highlight def link notesWindowsPath Directory
9194
@@ -113,7 +116,7 @@ syntax match notesTitle /^.*\%1l.*$/ contains=@notesInline
113116highlight def link notesTitle ModeMsg
114117
115118" 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
117120highlight def link notesShortHeading Title
118121
119122" Atx style headings are also supported. {{{2
0 commit comments