All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Many MediaWiki wikis prefer line breaks only at the end of paragraphs
2 " (like in a text processor), which results in long, wrapping lines.
3 setlocal wrap linebreak
7 setlocal formatoptions-=tc formatoptions+=l
8 if v:version >= 602 | setlocal formatoptions-=a | endif
10 " Make navigation more amenable to the long wrapping lines.
13 noremap <buffer> <Up> gk
14 noremap <buffer> <Down> gj
18 noremap <buffer> D dg$
19 noremap <buffer> C cg$
20 noremap <buffer> A g$a
22 inoremap <buffer> <Up> <C-O>gk
23 inoremap <buffer> <Down> <C-O>gj
25 " utf-8 should be set if not already done globally
26 setlocal fileencoding=utf-8
27 setlocal matchpairs+=<:>
29 " Treat lists, indented text and tables as comment lines and continue with the
30 " same formatting in the next line (i.e. insert the comment leader) when hitting
32 setlocal comments=n:#,n:*,n:\:,s:{\|,m:\|,ex:\|}
33 setlocal formatoptions+=roq
35 " match HTML tags (taken directly from $VIM/ftplugin/html.vim)
36 if exists("loaded_matchit")
37 let b:match_ignorecase=0
38 let b:match_skip = 's:Comment'
39 let b:match_words = '<:>,' .
40 \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
41 \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
42 \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
45 " Other useful mappings
46 " Insert a matching = automatically while starting a new header.
47 inoremap <buffer> <silent> = <C-R>=(getline('.')==''\|\|getline('.')=~'^=\+$')?"==\<Lt>Left>":"="<CR>
49 " Enable folding based on ==sections==
50 setlocal foldexpr=getline(v:lnum)=~'^\\(=\\+\\)[^=]\\+\\1\\(\\s*<!--.*-->\\)\\=\\s*$'?\">\".(len(matchstr(getline(v:lnum),'^=\\+'))-1):\"=\"