robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
7945732ed7
master
1" Vim filetype plugin 2" Language: Mermaid 3" Maintainer: Craig MacEachern <https://github.com/craigmac/vim-mermaid> 4" Last Change: 2022 Oct 13 5" 2024 Jul 18 by Vim Project (adjust comments) 6" 2026 Jun 27 by Vim Project (add recommended style guard) 7 8if exists ( "b:did_ftplugin" ) 9finish 10endif 11 12let s: keepcpo = & cpo 13set cpo & vim 14 15" Use mermaid live editor's style 16if get ( g:, 'mermaid_recommended_style' , 17 \get ( g:, 'filetype_recommended_style' , 1 )) 18setlocal expandtab 19setlocal shiftwidth = 2 20setlocal softtabstop = -1 21setlocal tabstop = 4 22endif 23 24setlocal comments = :%% 25setlocal commentstring = %%\ %s 26" TODO: comments, formatlist stuff, based on what? 27setlocal formatoptions += tcqlnformatoptions -= rformatoptions -= o 28setlocal formatlistpat = ^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} 29 30if exists ( 'b:undo_ftplugin' ) 31let b: undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<" 32else 33let b: undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<" 34endif 35 36if ! exists ( "g:no_plugin_maps" ) && ! exists ( "g:no_markdown_maps" ) 37nnoremap <silent><buffer> [[ :< C-U > call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> 38nnoremap <silent><buffer> ]] :< C-U > call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> 39xnoremap <silent><buffer> [[ :< C-U > exe "normal! gv"< Bar > call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> 40xnoremap <silent><buffer> ]] :< C-U > exe "normal! gv"< Bar > call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> 41let b: undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]' 42endif 43 44" if has("folding") && get(g:, "markdown_folding", 0) 45" setlocal foldexpr=MarkdownFold() 46" setlocal foldmethod=expr 47" setlocal foldtext=MarkdownFoldText() 48" let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<" 49" endif 50 51let & cpo = s: keepcpo 52unlet s: keepcpo 53 54" vim:set sw=2: