codekingpro/portable-devtools
114k
1" Language: MediaWiki2" Maintainer: Avid Seeker <avidseeker7@protonmail.com>3" Home: http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim4" Last Change: 2024 Jul 145" Credits: chikamichi6" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)7"8 9if exists("b:did_ftplugin")10 finish11endif12let b:did_ftplugin = 113 14let s:cpo_save = &cpo15set cpo&vim16 17" Many MediaWiki wikis prefer line breaks only at the end of paragraphs18" (like in a text processor), which results in long, wrapping lines.19setlocal wrap linebreak20setlocal textwidth=021 22setlocal formatoptions-=tc formatoptions+=l formatoptions+=roq23setlocal matchpairs+=<:>24 25" Treat lists, indented text and tables as comment lines and continue with the26" same formatting in the next line (i.e. insert the comment leader) when hitting27" <CR> or using "o".28setlocal comments=n:#,n:*,n:\:,s:{\|,m:\|,ex:\|},s:<!--,m:\ \ \ \ ,e:-->29setlocal commentstring=<!--\ %s\ -->30 31" match HTML tags (taken directly from $VIM/ftplugin/html.vim)32if exists("loaded_matchit")33 let b:match_ignorecase=034 let b:match_skip = 's:Comment'35 let b:match_words = '<:>,' .36 \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .37 \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .38 \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'39endif40 41" Enable folding based on ==sections==42setlocal foldexpr=getline(v:lnum)=~'^\\(=\\+\\)[^=]\\+\\1\\(\\s*<!--.*-->\\)\\=\\s*$'?\">\".(len(matchstr(getline(v:lnum),'^=\\+'))-1):\"=\"43setlocal foldmethod=expr44 45let b:undo_ftplugin = "setl commentstring< comments< formatoptions< foldexpr< foldmethod<"46let b:undo_ftplugin += " matchpairs< linebreak< wrap< textwidth<"47 48let &cpo = s:cpo_save49unlet s:cpo_save50 