Skip to content

Commit 7de3c95

Browse files
committed
Highlight inline code fragments (issue #60)
1 parent 9c8e701 commit 7de3c95

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

autoload/xolox/notes.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.25.2'
9+
let g:xolox#notes#version = '0.26'
1010
let g:xolox#notes#url_pattern = '\<\(mailto:\|javascript:\|\w\{3,}://\)\(\S*\w\)\+/\?'
1111
let s:scriptdir = expand('<sfile>:p:h')
1212

syntax/notes.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim syntax script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: July 6, 2014
3+
" Last Change: July 7, 2014
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Note: This file is encoded in UTF-8 including a byte order mark so
@@ -48,6 +48,16 @@ endif
4848
highlight def link notesSingleQuoted Special
4949
highlight def link notesDoubleQuoted String
5050

51+
" Highlight inline code fragments (same as Markdown syntax). {{{2
52+
if has('conceal')
53+
syntax region notesInlineCode matchgroup=notesInlineCodeMarker start=/`/ end=/`/ concealends
54+
highlight link notesItalicMarker notesInlineCodeMarker
55+
else
56+
syntax match notesInlineCode /`[^`]*`/
57+
endif
58+
syntax cluster notesInline add=notesInlineCode
59+
highlight def link notesInlineCode Special
60+
5161
" Highlight text emphasized in italic font. {{{2
5262
if has('conceal')
5363
syntax region notesItalic matchgroup=notesItalicMarker start=/\<_\k\@=/ end=/_\>\|\n/ contains=@Spell concealends

0 commit comments

Comments
 (0)