1
0
mirror of https://github.com/amix/vimrc synced 2025-07-01 12:45:00 +08:00

Updated vim plugins

This commit is contained in:
Amir
2022-12-03 11:29:32 +01:00
parent d8db85c663
commit 2b653aa950
32 changed files with 650 additions and 110 deletions

View File

@ -494,7 +494,9 @@ endfunction
function! s:SetexToAtx(line1, line2)
let l:originalNumLines = line('$')
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n\=+$/# \1/'
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n-+$/## \1/'
let l:changed = l:originalNumLines - line('$')
execute 'silent! ' . a:line1 . ',' . (a:line2 - l:changed) . 'substitute/\v(.*\S.*)\n-+$/## \1'
return l:originalNumLines - line('$')
endfunction
@ -854,19 +856,23 @@ function! s:SyntaxInclude(filetype)
return grouplistname
endfunction
function! s:IsHighlightSourcesEnabledForBuffer()
" Enable for markdown buffers, and for liquid buffers with markdown format
return &filetype =~# 'markdown' || get(b:, 'liquid_subtype', '') =~# 'markdown'
endfunction
function! s:MarkdownRefreshSyntax(force)
" Use != to compare &syntax's value to use the same logic run on
" $VIMRUNTIME/syntax/synload.vim.
"
" vint: next-line -ProhibitEqualTildeOperator
if &filetype =~# 'markdown' && line('$') > 1 && &syntax != 'OFF'
if s:IsHighlightSourcesEnabledForBuffer() && line('$') > 1 && &syntax != 'OFF'
call s:MarkdownHighlightSources(a:force)
endif
endfunction
function! s:MarkdownClearSyntaxVariables()
if &filetype =~# 'markdown'
if s:IsHighlightSourcesEnabledForBuffer()
unlet! b:mkd_included_filetypes
endif
endfunction