robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
a4ee34a165
master
1" reStructuredText filetype plugin file 2" Language: reStructuredText documentation format 3" Maintainer: Marshall Ward <marshall.ward@gmail.com> 4" Original Maintainer: Nikolai Weibull <now@bitwi.se> 5" Website: https://github.com/marshallward/vim-restructuredtext 6" Latest Revision: 2020-03-31 7" 2025 Oct 13 by Vim project: update b:undo_ftplugin #18566 8" 2026 Jan 11 by Vim project: set suffixesadd #19149 9 10if exists ( "b:did_ftplugin" ) 11finish 12endif 13let b: did_ftplugin = 1 14 15let s: cpo_save = & cpo 16set cpo & vim 17 18"Disable folding 19if ! exists ( 'g:rst_fold_enabled' ) 20let g: rst_fold_enabled = 0 21endif 22 23let b: undo_ftplugin = "setlocal comments< commentstring< expandtab< formatoptions< suffixesadd<" 24 25setlocal comments = fb:..commentstring = ..\ %sexpandtab 26setlocal formatoptions += tcroql 27setlocal suffixesadd = .rst 28 29" reStructuredText standard recommends that tabs be expanded to 8 spaces 30" The choice of 3-space indentation is to provide slightly better support for 31" directives (..) and ordered lists (1.), although it can cause problems for 32" many other cases. 33" 34" More sophisticated indentation rules should be revisited in the future. 35 36if exists ( "g:rst_style" ) && g: rst_style != 0 37setlocal expandtab shiftwidth = 3 softtabstop = 3 tabstop = 8 38let b: undo_ftplugin .= " | setlocal softtabstop< shiftwidth< tabstop<" 39endif 40 41if g: rst_fold_enabled != 0 42setlocal foldmethod = expr 43setlocal foldexpr = RstFold #GetRstFold() 44setlocal foldtext = RstFold #GetRstFoldText() 45augroup RstFold 46autocmd TextChanged , InsertLeave <buffer> unlet ! b: RstFoldCache 47augroup END 48let b: undo_ftplugin .= " | setlocal foldexpr< foldmethod< foldtext<" 49endif 50 51let & cpo = s: cpo_save 52unlet s: cpo_save