Permalink
Browse files

Highlight inline code fragments (issue #60)

  • Loading branch information...
1 parent 9c8e701 commit 7de3c953475557f064b4b552c7b7fe3eef83c717 @xolox committed Jul 6, 2014
Showing with 12 additions and 2 deletions.
  1. +1 −1 autoload/xolox/notes.vim
  2. +11 −1 syntax/notes.vim
View
@@ -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')
View
@@ -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
@@ -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

0 comments on commit 7de3c95

Please sign in to comment.