mirror of
https://github.com/amix/vimrc
synced 2025-06-23 06:35:01 +08:00
Updated plugins
This commit is contained in:
@ -20,6 +20,14 @@ To disable markdown syntax concealing add the following to your vimrc:
|
||||
|
||||
let g:markdown_syntax_conceal = 0
|
||||
|
||||
Syntax highlight is synchronized in 50 lines. It may cause collapsed
|
||||
highlighting at large fenced code block.
|
||||
In the case, please set larger value in your vimrc:
|
||||
|
||||
let g:markdown_minlines = 100
|
||||
|
||||
Note that setting too large value may cause bad performance on highlighting.
|
||||
|
||||
## License
|
||||
|
||||
Copyright © Tim Pope. Distributed under the same terms as Vim itself.
|
||||
|
@ -41,10 +41,35 @@ function! MarkdownFold()
|
||||
return "="
|
||||
endfunction
|
||||
|
||||
function! MarkdownFoldText()
|
||||
let hash_indent = s:HashIndent(v:foldstart)
|
||||
let title = substitute(getline(v:foldstart), '^#\+\s*', '', '')
|
||||
let foldsize = (v:foldend - v:foldstart + 1)
|
||||
let linecount = '['.foldsize.' lines]'
|
||||
return hash_indent.' '.title.' '.linecount
|
||||
endfunction
|
||||
|
||||
function! s:HashIndent(lnum)
|
||||
let hash_header = matchstr(getline(a:lnum), '^#\{1,6}')
|
||||
if len(hash_header) > 0
|
||||
" hashtag header
|
||||
return hash_header
|
||||
else
|
||||
" == or -- header
|
||||
let nextline = getline(a:lnum + 1)
|
||||
if nextline =~ '^=\+\s*$'
|
||||
return repeat('#', 1)
|
||||
elseif nextline =~ '^-\+\s*$'
|
||||
return repeat('#', 2)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
if has("folding") && exists("g:markdown_folding")
|
||||
setlocal foldexpr=MarkdownFold()
|
||||
setlocal foldmethod=expr
|
||||
let b:undo_ftplugin .= " foldexpr< foldmethod<"
|
||||
setlocal foldtext=MarkdownFoldText()
|
||||
let b:undo_ftplugin .= " foldexpr< foldmethod< foldtext<"
|
||||
endif
|
||||
|
||||
" vim:set sw=2:
|
||||
|
@ -33,7 +33,10 @@ endfor
|
||||
unlet! s:type
|
||||
unlet! s:done_include
|
||||
|
||||
syn sync minlines=10
|
||||
if !exists('g:markdown_minlines')
|
||||
let g:markdown_minlines = 50
|
||||
endif
|
||||
execute 'syn sync minlines=' . g:markdown_minlines
|
||||
syn case ignore
|
||||
|
||||
syn match markdownValid '[<>]\c[a-z/$!]\@!'
|
||||
|
Reference in New Issue
Block a user