org.vim (1008B)
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 7 8 if exists("b:did_ftplugin") 9 finish 10 endif 11 let b:did_ftplugin = 1 12 13 if exists('b:undo_ftplugin') 14 let b:undo_ftplugin .= "|setl cms< com< fo< flp<" 15 else 16 let b:undo_ftplugin = "setl cms< com< fo< flp<" 17 endif 18 19 setl commentstring=#\ %s 20 setl comments=fb:*,fb:-,fb:+,b:#,b:\: 21 22 setl formatoptions+=nql 23 setl formatlistpat=^\\s*\\(\\(\\d\\|\\a\\)\\+[.)]\\|[+-]\\)\\s\\+ 24 25 function OrgFoldExpr() 26 let l:depth = match(getline(v:lnum), '\(^\*\+\)\@<=\( .*$\)\@=') 27 if l:depth > 0 && synIDattr(synID(v:lnum, 1, 1), 'name') =~# '\m^orgHeadline' 28 return ">" . l:depth 29 endif 30 return "=" 31 endfunction 32 33 if has("folding") && get(g:, 'org_folding', 0) 34 setl foldexpr=OrgFoldExpr() 35 setl foldmethod=expr 36 let b:undo_ftplugin .= "|setl foldexpr< foldmethod<" 37 endif 38 39 " vim: ts=8 sts=2 sw=2 et