Mercurial > vim
comparison runtime/ftplugin/markdown.vim @ 30875:3295247d97a5
Update runtime files
Commit: https://github.com/vim/vim/commit/3c053a1a5ad2a3c924929e11f2b9af20a8b901e2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 16 13:11:12 2022 +0100
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 Oct 2022 14:15:06 +0200 |
parents | 5c40013d45ee |
children | 4a67df32683d |
comparison
equal
deleted
inserted
replaced
30874:479022a91414 | 30875:3295247d97a5 |
---|---|
1 " Vim filetype plugin | 1 " Vim filetype plugin |
2 " Language: Markdown | 2 " Language: Markdown |
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> | 3 " Maintainer: Tim Pope <https://github.com/tpope/vim-markdown> |
4 " Last Change: 2019 Dec 05 | 4 " Last Change: 2022 Oct 13 |
5 | 5 |
6 if exists("b:did_ftplugin") | 6 if exists("b:did_ftplugin") |
7 finish | 7 finish |
8 endif | 8 endif |
9 | 9 |
10 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim | 10 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim |
11 | 11 |
12 let s:keepcpo= &cpo | |
13 set cpo&vim | |
14 | |
12 setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s--> | 15 setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s--> |
13 setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o | 16 setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o |
14 setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]: | 17 setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} |
15 | 18 |
16 if exists('b:undo_ftplugin') | 19 if exists('b:undo_ftplugin') |
17 let b:undo_ftplugin .= "|setl cms< com< fo< flp<" | 20 let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<" |
18 else | 21 else |
19 let b:undo_ftplugin = "setl cms< com< fo< flp<" | 22 let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<" |
23 endif | |
24 | |
25 if get(g:, 'markdown_recommended_style', 1) | |
26 setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4 | |
27 endif | |
28 | |
29 if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps") | |
30 nnoremap <silent><buffer> [[ :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> | |
31 nnoremap <silent><buffer> ]] :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> | |
32 xnoremap <silent><buffer> [[ :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> | |
33 xnoremap <silent><buffer> ]] :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> | |
34 let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]' | |
20 endif | 35 endif |
21 | 36 |
22 function! s:NotCodeBlock(lnum) abort | 37 function! s:NotCodeBlock(lnum) abort |
23 return synIDattr(synID(v:lnum, 1, 1), 'name') !=# 'markdownCode' | 38 return synIDattr(synID(a:lnum, 1, 1), 'name') !=# 'markdownCode' |
24 endfunction | 39 endfunction |
25 | 40 |
26 function! MarkdownFold() abort | 41 function! MarkdownFold() abort |
27 let line = getline(v:lnum) | 42 let line = getline(v:lnum) |
28 | 43 |
62 let foldsize = (v:foldend - v:foldstart + 1) | 77 let foldsize = (v:foldend - v:foldstart + 1) |
63 let linecount = '['.foldsize.' lines]' | 78 let linecount = '['.foldsize.' lines]' |
64 return hash_indent.' '.title.' '.linecount | 79 return hash_indent.' '.title.' '.linecount |
65 endfunction | 80 endfunction |
66 | 81 |
67 if has("folding") && exists("g:markdown_folding") | 82 if has("folding") && get(g:, "markdown_folding", 0) |
68 setlocal foldexpr=MarkdownFold() | 83 setlocal foldexpr=MarkdownFold() |
69 setlocal foldmethod=expr | 84 setlocal foldmethod=expr |
70 setlocal foldtext=MarkdownFoldText() | 85 setlocal foldtext=MarkdownFoldText() |
71 let b:undo_ftplugin .= " foldexpr< foldmethod< foldtext<" | 86 let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<" |
72 endif | 87 endif |
73 | 88 |
89 let &cpo = s:keepcpo | |
90 unlet s:keepcpo | |
91 | |
74 " vim:set sw=2: | 92 " vim:set sw=2: |