Skip to content

Commit

Permalink
Highlight inline code fragments (issue #60)
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jul 6, 2014
1 parent 9c8e701 commit 7de3c95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autoload/xolox/notes.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
" Note: This file is encoded in UTF-8 including a byte order mark so
" that Vim loads the script using the right encoding transparently.

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

Expand Down
12 changes: 11 additions & 1 deletion syntax/notes.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" Vim syntax script
" Author: Peter Odding <peter@peterodding.com>
" Last Change: July 6, 2014
" Last Change: July 7, 2014
" URL: http://peterodding.com/code/vim/notes/

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

" Highlight inline code fragments (same as Markdown syntax). {{{2
if has('conceal')
syntax region notesInlineCode matchgroup=notesInlineCodeMarker start=/`/ end=/`/ concealends
highlight link notesItalicMarker notesInlineCodeMarker
else
syntax match notesInlineCode /`[^`]*`/
endif
syntax cluster notesInline add=notesInlineCode
highlight def link notesInlineCode Special

" Highlight text emphasized in italic font. {{{2
if has('conceal')
syntax region notesItalic matchgroup=notesItalicMarker start=/\<_\k\@=/ end=/_\>\|\n/ contains=@Spell concealends
Expand Down

0 comments on commit 7de3c95

Please sign in to comment.