mirror of
https://github.com/amix/vimrc
synced 2025-06-23 06:35:01 +08:00
Updated plugins
This commit is contained in:
@ -277,6 +277,14 @@ JSON syntax highlight requires [vim-json](https://github.com/elzr/vim-json).
|
||||
let g:vim_markdown_json_frontmatter = 1
|
||||
```
|
||||
|
||||
#### Strikethrough
|
||||
|
||||
Strikethrough uses two tildes. `~~Scratch this.~~`
|
||||
|
||||
```vim
|
||||
let g:vim_markdown_strikethrough = 1
|
||||
```
|
||||
|
||||
### Adjust new list item indent
|
||||
|
||||
You can adjust a new list indent. For example, you insert a single line like below:
|
||||
|
@ -24,6 +24,7 @@ Contents ~
|
||||
2. YAML Front Matter |vim-markdown-yaml-front-matter|
|
||||
3. TOML Front Matter |vim-markdown-toml-front-matter|
|
||||
4. JSON Front Matter |vim-markdown-json-front-matter|
|
||||
5. Strikethrough |vim-markdown-strikethrough|
|
||||
11. Adjust new list item indent |vim-markdown-adjust-new-list-item-indent|
|
||||
12. Do not require .md extensions for Markdown links
|
||||
|vim-markdown-do-not-require-.md-extensions-for-markdown-links|
|
||||
@ -318,6 +319,14 @@ JSON syntax highlight requires vim-json [9].
|
||||
>
|
||||
let g:vim_markdown_json_frontmatter = 1
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*vim-markdown-strikethrough*
|
||||
Strikethrough ~
|
||||
|
||||
Strikethrough uses two tildes. '~~Scratch this.~~'
|
||||
>
|
||||
let g:vim_markdown_strikethrough = 1
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*vim-markdown-adjust-new-list-item-indent*
|
||||
Adjust new list item indent ~
|
||||
|
@ -768,13 +768,13 @@ endfunction
|
||||
|
||||
|
||||
function! s:MarkdownRefreshSyntax(force)
|
||||
if &filetype == 'markdown' && line('$') > 1
|
||||
if &filetype =~ 'markdown' && line('$') > 1
|
||||
call s:MarkdownHighlightSources(a:force)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:MarkdownClearSyntaxVariables()
|
||||
if &filetype == 'markdown'
|
||||
if &filetype =~ 'markdown'
|
||||
unlet! b:mkd_included_filetypes
|
||||
endif
|
||||
endfunction
|
||||
|
@ -98,7 +98,7 @@ syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell
|
||||
"define Markdown groups
|
||||
syn match mkdLineBreak / \+$/
|
||||
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/' . s:concealcode
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/`/' . s:concealcode
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!``/ skip=/[^`]`[^`]/ end=/\(\([^\\]\|^\)\\\)\@<!``/' . s:concealcode
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealcode
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealcode
|
||||
@ -149,7 +149,13 @@ if get(g:, 'vim_markdown_math', 0)
|
||||
syn region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
|
||||
endif
|
||||
|
||||
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath
|
||||
" Strike through
|
||||
if get(g:, 'vim_markdown_strikethrough', 0)
|
||||
syn region mkdStrike matchgroup=mkdStrike start="\%(\~\~\)" end="\%(\~\~\)"
|
||||
HtmlHiLink mkdStrike htmlStrike
|
||||
endif
|
||||
|
||||
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath,htmlStrike
|
||||
|
||||
"highlighting for Markdown groups
|
||||
HtmlHiLink mkdString String
|
||||
|
@ -882,6 +882,23 @@ a
|
||||
Execute (not code block in escaped code tag):
|
||||
AssertNotEqual SyntaxOf('a'), 'mkdCode'
|
||||
|
||||
# Code quotes
|
||||
|
||||
Given markdown;
|
||||
`a`
|
||||
|
||||
Execute (code in code quotes):
|
||||
AssertEqual SyntaxOf('a'), 'mkdCode'
|
||||
|
||||
Given markdown;
|
||||
`a\` b `c\` d
|
||||
|
||||
Execute (code quotes not escaped ending with backslash):
|
||||
AssertEqual SyntaxOf('a\'), 'mkdCode'
|
||||
AssertNotEqual SyntaxOf('b'), 'mkdCode'
|
||||
AssertEqual SyntaxOf('c\'), 'mkdCode'
|
||||
AssertNotEqual SyntaxOf('d'), 'mkdCode'
|
||||
|
||||
# Math
|
||||
|
||||
Given markdown;
|
||||
|
@ -11,14 +11,14 @@ filetype indent on
|
||||
syntax on
|
||||
|
||||
function! Markdown_GetScriptID(fname) abort
|
||||
let a:snlist = ''
|
||||
redir => a:snlist
|
||||
let l:snlist = ''
|
||||
redir => l:snlist
|
||||
silent! scriptnames
|
||||
redir END
|
||||
let a:mx = '^\s*\(\d\+\):\s*\(.*\)$'
|
||||
for a:line in split(a:snlist, "\n")
|
||||
if stridx(substitute(a:line, '\\', '/', 'g'), a:fname) >= 0
|
||||
return substitute(a:line, a:mx, '\1', '')
|
||||
let l:mx = '^\s*\(\d\+\):\s*\(.*\)$'
|
||||
for l:line in split(l:snlist, "\n")
|
||||
if stridx(substitute(l:line, '\\', '/', 'g'), a:fname) >= 0
|
||||
return substitute(l:line, l:mx, '\1', '')
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user