org.vim (1068B)
1 " Vim filetype plugin file 2 " Language: Org 3 " Previous Maintainer: Luca Saccarola <github.e41mv@aleeas.com> 4 " Maintainer: This runtime file is looking for a new maintainer. 5 " Last Change: 2025 Aug 05 6 " 2026 Sep 07 by Vim project: fix escape in formatlistpat 7 8 9 if exists("b:did_ftplugin") 10 finish 11 endif 12 let b:did_ftplugin = 1 13 14 if exists('b:undo_ftplugin') 15 let b:undo_ftplugin .= "|setl cms< com< fo< flp<" 16 else 17 let b:undo_ftplugin = "setl cms< com< fo< flp<" 18 endif 19 20 setl commentstring=#\ %s 21 setl comments=fb:*,fb:-,fb:+,b:#,b:\: 22 23 setl formatoptions+=nql 24 setl formatlistpat=^\\s*\\(\\(\\d\\\|\\a\\)\\+[.)]\\\|[+-]\\)\\s\\+ 25 26 function OrgFoldExpr() 27 let l:depth = match(getline(v:lnum), '\(^\*\+\)\@<=\( .*$\)\@=') 28 if l:depth > 0 && synIDattr(synID(v:lnum, 1, 1), 'name') =~# '\m^orgHeadline' 29 return ">" . l:depth 30 endif 31 return "=" 32 endfunction 33 34 if has("folding") && get(g:, 'org_folding', 0) 35 setl foldexpr=OrgFoldExpr() 36 setl foldmethod=expr 37 let b:undo_ftplugin .= "|setl foldexpr< foldmethod<" 38 endif 39 40 " vim: ts=8 sts=2 sw=2 et