diff --git a/README.md b/README.md index 0d60c7e..d73d7cc 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,30 @@ This option defines the pathname of the text file that stores the list of known The `:NoteToHtml` command requires the [Markdown] [markdown] program. By default the name of this program is assumed to be simply `markdown`. If you want to use a different program for Markdown to HTML conversion, set this option to the name of the program. +### The `g:notes_conceal_code` option + +By default the backticks that mark inline code snippets are hidden when your version of Vim supports concealing of text. By setting this option to zero you stop vim-notes from hiding those backticks. In the following example, the backticks would be visible in the editor when this option is set to zero: + + This is a sentence with an `inline code` fragment. + +### The `g:notes_conceal_italic` option + +By default the underscores that mark italic text are hidden when your version of Vim supports concealing of text. By setting this option to zero you stop vim-notes from hiding those underscores. In the following example, the underscores would be visible in the editor when this option is set to zero: + + This is a sentence with _italic_ text. + +### The `g:notes_conceal_bold` option + +By default the stars that mark bold text are hidden when your version of Vim supports concealing of text. By setting this option to zero you stop vim-notes from hiding those stars. In the following example, the stars would be visible in the editor when this option is set to zero: + + This is a sentence with *bold* text. + +### The `g:notes_conceal_url` option + +By default URL schemes (text fragments like `http://`) are hidden when your version of Vim supports concealing of text. By setting this option to zero you stop vim-notes from hiding URL schemes. In the following example, the `https://` text would be visible in the editor when this option is set to zero: + + You can find the vim-notes plug-in at https://github.com/xolox/vim-notes. + ## Commands To edit one of your existing notes (or create a new one) you can use Vim commands such as [:edit] [edit], [:split] [split] and [:tabedit] [tabedit] with a filename that starts with *note:* followed by (part of) the title of one of your notes, e.g.: diff --git a/autoload/xolox/notes.vim b/autoload/xolox/notes.vim index a3e40ae..51ce0f7 100644 --- a/autoload/xolox/notes.vim +++ b/autoload/xolox/notes.vim @@ -1,12 +1,12 @@ " Vim auto-load script " Author: Peter Odding -" Last Change: March 5, 2015 +" Last Change: March 15, 2015 " URL: http://peterodding.com/code/vim/notes/ " 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.31.1' +let g:xolox#notes#version = '0.32' let g:xolox#notes#url_pattern = '\<\(mailto:\|javascript:\|\w\{3,}://\)\(\S*\w\)\+/\?' let s:scriptdir = expand(':p:h') diff --git a/doc/notes.txt b/doc/notes.txt index 19c0c2e..dfb5109 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -22,6 +22,10 @@ Contents ~ 13. The |g:notes_indexscript| option 14. The |g:notes_tagsindex| option 15. The |g:notes_markdown_program| option + 16. The |g:notes_conceal_code| option + 17. The |g:notes_conceal_italic| option + 18. The |g:notes_conceal_bold| option + 19. The |g:notes_conceal_url| option 4. Commands |notes-commands| 1. The |:Note| command 2. The |:NoteFromSelectedText| command @@ -338,6 +342,46 @@ name of this program is assumed to be simply 'markdown'. If you want to use a different program for Markdown to HTML conversion, set this option to the name of the program. +------------------------------------------------------------------------------- +The *g:notes_conceal_code* option + +By default the backticks that mark inline code snippets are hidden when your +version of Vim supports concealing of text. By setting this option to zero you +stop vim-notes from hiding those backticks. In the following example, the +backticks would be visible in the editor when this option is set to zero: +> + This is a sentence with an `inline code` fragment. +< +------------------------------------------------------------------------------- +The *g:notes_conceal_italic* option + +By default the underscores that mark italic text are hidden when your version +of Vim supports concealing of text. By setting this option to zero you stop +vim-notes from hiding those underscores. In the following example, the +underscores would be visible in the editor when this option is set to zero: +> + This is a sentence with _italic_ text. +< +------------------------------------------------------------------------------- +The *g:notes_conceal_bold* option + +By default the stars that mark bold text are hidden when your version of Vim +supports concealing of text. By setting this option to zero you stop vim-notes +from hiding those stars. In the following example, the stars would be visible +in the editor when this option is set to zero: +> + This is a sentence with *bold* text. +< +------------------------------------------------------------------------------- +The *g:notes_conceal_url* option + +By default URL schemes (text fragments like 'http://') are hidden when your +version of Vim supports concealing of text. By setting this option to zero you +stop vim-notes from hiding URL schemes. In the following example, the +'https://' text would be visible in the editor when this option is set to zero: +> + You can find the vim-notes plug-in at https://github.com/xolox/vim-notes. +< =============================================================================== *notes-commands* Commands ~ diff --git a/syntax/notes.vim b/syntax/notes.vim index 2b81b35..dff6918 100644 --- a/syntax/notes.vim +++ b/syntax/notes.vim @@ -1,6 +1,6 @@ " Vim syntax script " Author: Peter Odding -" Last Change: November 27, 2014 +" Last Change: March 15, 2015 " URL: http://peterodding.com/code/vim/notes/ " Note: This file is encoded in UTF-8 including a byte order mark so @@ -57,7 +57,7 @@ highlight def link notesSingleQuoted Special highlight def link notesDoubleQuoted String " Highlight inline code fragments (same as Markdown syntax). {{{2 -if has('conceal') +if has('conceal') && xolox#misc#option#get('notes_conceal_code', 1) syntax region notesInlineCode matchgroup=notesInlineCodeMarker start=/`/ end=/`/ concealends highlight link notesItalicMarker notesInlineCodeMarker else @@ -67,7 +67,7 @@ syntax cluster notesInline add=notesInlineCode highlight def link notesInlineCode Special " Highlight text emphasized in italic font. {{{2 -if has('conceal') +if has('conceal') && xolox#misc#option#get('notes_conceal_italic', 1) syntax region notesItalic matchgroup=notesItalicMarker start=/\<_\k\@=/ end=/_\>\|\n/ contains=@Spell concealends highlight link notesItalicMarker notesHiddenMarker else @@ -77,7 +77,7 @@ syntax cluster notesInline add=notesItalic highlight notesItalic gui=italic cterm=italic " Highlight text emphasized in bold font. {{{2 -if has('conceal') +if has('conceal') && xolox#misc#option#get('notes_conceal_bold', 1) syntax region notesBold matchgroup=notesBoldMarker start=/\*\k\@=/ end=/\S\@<=\*/ contains=@Spell concealends highlight link notesBoldMarker notesHiddenMarker else @@ -97,7 +97,7 @@ highlight def link notesTextURL notesSubtleURL execute printf('syntax match notesRealURL @%s@', g:xolox#notes#url_pattern) syntax cluster notesInline add=notesRealURL highlight def link notesRealURL notesSubtleURL -if has('conceal') +if has('conceal') && xolox#misc#option#get('notes_conceal_url', 1) syntax match notesUrlScheme @\(mailto:\|javascript:\|\w\{3,}://\)@ contained containedin=notesRealURL conceal highlight def link notesUrlScheme notesRealURL endif