Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rst.vim53 linesDownload Raw Back to ftplugin
1" reStructuredText filetype plugin file2" Language: reStructuredText documentation format3" Maintainer: Marshall Ward <marshall.ward@gmail.com>4" Original Maintainer: Nikolai Weibull <now@bitwi.se>5" Website: https://github.com/marshallward/vim-restructuredtext6" Latest Revision: 2020-03-317" 2025 Oct 13 by Vim project: update b:undo_ftplugin #185668" 2026 Jan 11 by Vim project: set suffixesadd #191499 10if exists("b:did_ftplugin")11    finish12endif13let b:did_ftplugin = 114 15let s:cpo_save = &cpo16set cpo&vim17 18"Disable folding19if !exists('g:rst_fold_enabled')20  let g:rst_fold_enabled = 021endif22 23let b:undo_ftplugin = "setlocal comments< commentstring< expandtab< formatoptions< suffixesadd<"24 25setlocal comments=fb:.. commentstring=..\ %s expandtab26setlocal formatoptions+=tcroql27setlocal suffixesadd=.rst28 29" reStructuredText standard recommends that tabs be expanded to 8 spaces30" The choice of 3-space indentation is to provide slightly better support for31" directives (..) and ordered lists (1.), although it can cause problems for32" many other cases.33"34" More sophisticated indentation rules should be revisited in the future.35 36if exists("g:rst_style") && g:rst_style != 037    setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=838    let b:undo_ftplugin .= " | setlocal softtabstop< shiftwidth< tabstop<"39endif40 41if g:rst_fold_enabled != 042  setlocal foldmethod=expr43  setlocal foldexpr=RstFold#GetRstFold()44  setlocal foldtext=RstFold#GetRstFoldText()45  augroup RstFold46    autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache47  augroup END48  let b:undo_ftplugin .= " | setlocal foldexpr< foldmethod< foldtext<"49endif50 51let &cpo = s:cpo_save52unlet s:cpo_save53