1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins

This commit is contained in:
amix
2017-05-02 14:42:08 +02:00
parent c4fbfe8aa8
commit 85e105159e
63 changed files with 1389 additions and 737 deletions

View File

@ -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: