1
0
mirror of https://github.com/amix/vimrc synced 2025-06-30 11:54:59 +08:00

Updated plugins

This commit is contained in:
Amir
2024-10-06 10:25:50 +02:00
parent ee7e062909
commit 46294d589d
202 changed files with 306918 additions and 203617 deletions

View File

@ -68,8 +68,10 @@ The following commands are useful to open and close folds:
- `zR`: opens all folds
- `zm`: increases fold level throughout the buffer
- `zM`: folds everything all the way
- `za`: open a fold your cursor is on
- `zA`: open a fold your cursor is on recursively
- `za`: toggle a fold your cursor is on
- `zA`: toggle a fold your cursor is on recursively
- `zo`: open a fold your cursor is on
- `zO`: open a fold your cursor is on recursively
- `zc`: close a fold your cursor is on
- `zC`: close a fold your cursor is on recursively

View File

@ -14,15 +14,21 @@ endfunction
if get(g:, 'vim_markdown_folding_style_pythonic', 0)
function! Foldexpr_markdown(lnum)
if (a:lnum == 1)
let b:fence_str = ''
endif
let l1 = getline(a:lnum)
"~~~~~ keep track of fenced code blocks ~~~~~
"If we hit a code block fence
if l1 =~# '````*' || l1 =~# '\~\~\~\~*'
if l1 =~# '\v^[[:space:]>]*\v(`{3,}|\~{3,})\s*(\w+)?\s*$'
" toggle the variable that says if we're in a code block
if b:fenced_block == 0
let b:fenced_block = 1
elseif b:fenced_block == 1
let b:fence_str = matchstr(l1, '\v(`{3,}|\~{3,})')
elseif b:fenced_block == 1 && matchstr(l1, '\v(`{3,}|\~{3,})') ==# b:fence_str
let b:fenced_block = 0
let b:fence_str = ''
endif
" else, if we're caring about front matter
elseif get(g:, 'vim_markdown_frontmatter', 0) == 1
@ -100,16 +106,19 @@ else " vim_markdown_folding_style_pythonic == 0
function! Foldexpr_markdown(lnum)
if (a:lnum == 1)
let l0 = ''
let b:fence_str = ''
else
let l0 = getline(a:lnum-1)
endif
" keep track of fenced code blocks
if l0 =~# '````*' || l0 =~# '\~\~\~\~*'
if l0 =~# '\v^[[:space:]>]*\v(`{3,}|\~{3,})\s*(\w+)?\s*$'
if b:fenced_block == 0
let b:fenced_block = 1
elseif b:fenced_block == 1
let b:fence_str = matchstr(l0, '\v(`{3,}|\~{3,})')
elseif b:fenced_block == 1 && matchstr(l0, '\v(`{3,}|\~{3,})') ==# b:fence_str
let b:fenced_block = 0
let b:fence_str = ''
endif
elseif get(g:, 'vim_markdown_frontmatter', 0) == 1
if b:front_matter == 1

View File

@ -102,9 +102,13 @@ The following commands are useful to open and close folds:
*vim-markdown-zM*
- 'zM': folds everything all the way
*vim-markdown-za*
- 'za': open a fold your cursor is on
- 'za': toggle a fold your cursor is on
*vim-markdown-zA*
- 'zA': open a fold your cursor is on recursively
- 'zA': toggle a fold your cursor is on recursively
*vim-markdown-zo*
- 'zo': open a fold your cursor is on
*vim-markdown-zO*
- 'zO': open a fold your cursor is on recursively
*vim-markdown-zc*
- 'zc': close a fold your cursor is on
*vim-markdown-zC*

View File

@ -162,16 +162,19 @@ function! s:GetHeaderList()
let l:front_matter = 0
let l:header_list = []
let l:vim_markdown_frontmatter = get(g:, 'vim_markdown_frontmatter', 0)
let l:fence_str = ''
for i in range(1, line('$'))
let l:lineraw = getline(i)
let l:l1 = getline(i+1)
let l:line = substitute(l:lineraw, '#', "\\\#", 'g')
" exclude lines in fenced code blocks
if l:line =~# '````*' || l:line =~# '\~\~\~\~*'
if l:line =~# '\v^[[:space:]>]*(`{3,}|\~{3,})\s*(\w+)?\s*$'
if l:fenced_block == 0
let l:fenced_block = 1
elseif l:fenced_block == 1
let l:fence_str = matchstr(l:line, '\v(`{3,}|\~{3,})')
elseif l:fenced_block == 1 && matchstr(l:line, '\v(`{3,}|\~{3,})') ==# l:fence_str
let l:fenced_block = 0
let l:fence_str = ''
endif
" exclude lines in frontmatters
elseif l:vim_markdown_frontmatter == 1

View File

@ -156,7 +156,7 @@ if get(g:, 'vim_markdown_strikethrough', 0)
HtmlHiLink mkdStrike htmlStrike
endif
syn cluster mkdHeadingContent contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdLink,mkdInlineURL,mkdStrike
syn cluster mkdHeadingContent contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdLink,mkdInlineURL,mkdStrike,mkdCode
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath,mkdStrike
"highlighting for Markdown groups