Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Text editor support
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==How to set up specific editors for Wikipedia editing== ===Atom=== [[Atom_(text_editor)|Atom]] requires at least one of the two packages to support syntax highlighting. Install packages using '''Command-,''' - '''Install''' and search for: * language-mediawiki * language-markdown ===Bluefish=== [[Bluefish_(software)|Bluefish]] supports Mediawiki syntax by default. If the auto-detection of the document language fails select the menu Document โ Language โ Mediawiki to enable syntax highlighting and auto completion. Specific Mediawiki syntax highlighting options can be configured in the Preferences panel under Language support โ Mediawiki. ===GNU Emacs=== A few [[Emacs]] ''major mode'' implementations are available for editing MediaWiki syntax: * [http://github.com/hexmode/mediawiki-el mediawiki.el on github]. "โฆ adds the ability to edit sites hosted on Mediawiki (including Wikipedia, of course)." * wikitext-mode.el, see [https://www.emacswiki.org/emacs/WikitextMode WikitextMode on EmacsWiki]. Derived from WikipediaMode v.0.3.3. Source is [https://www.emacswiki.org/emacs/wikitext-mode.el available] but documentation has [[link rot|link rotted]]. * [[Wikipedia:wikipedia-mode.el|wikipedia-mode.el]] (obsolete) is a simple major mode that mostly provides [[syntax highlighting]] for MediaWiki [[mark-up]]. * [http://www.gna.org/projects/wikipedia-el/ wikipedia.el] (obsolete) is a much more advanced major mode. It provides [[WYSIWYG]] editor for Wikipedia articles. Note, however, that it is developed using the current [[Concurrent Versions System|CVS]] version of GNU Emacs, may not be compatible with older versions, and has been effectively discontinued because it's not being actively maintained. Also, the mode was in the [[Software release life cycle#Alpha|alpha stage of development]] when it was orphaned, so use it at your own risk. ====Line formatting==== <code>longlines.el</code> is now part of the default GNU Emacs distribution. The following information is retained for reference. Wikipedia articles [[Wikipedia:don't use line breaks|don't use line breaks]]. Because of this, you may want to install one of the following: * [http://www.emacswiki.org/elisp/longlines.el longlines.el] โ implements "word wrap" functionality for Emacs (<code>longlines.el</code> is now part of GNU Emacs). [[Wikipedia:Wikipedia-mode.el#Installing longlines-mode|Installation instructions for <code>longlines.el</code>]]. * [http://homepage1.nifty.com/bmonkey/emacs/elisp/screen-lines.el screen-lines.el] โ redefines movement commands to operate in terms of screen lines as opposed to logical lines ====Access methods==== [http://www.emacswiki.org/emacs/WikipediaFs wikipediafs.el] can be used along with one of the aforementioned major modes, when using the virtual [http://wikipediafs.sourceforge.net/ Wikipedia filesystem]. ===jEdit=== For [[jEdit]] (Java-supporting OSes) there is a plugin available at http://www.djini.de/software/mwjed/ . Apart from providing syntax highlighting for Wikipedia markup, it can communicate directly with the Wikipedia website using the HttpClient component from the [[Jakarta Project]]. ''(Unavailable as of 2012-03-20.)'' ===Kate/KWrite=== [[Kate (text editor)|Kate]] (text editor on KDE framework) supports MediaWiki syntax highlighting by default. Choose <code>Tools โ Highlighting โ Markup โ Mediawiki</code>. It recognizes everything in default markup: * HTML tags and entities * Wiki control characters * Templates * Variables * Keywords * Links * Section titles * Tables * {{tag|nowiki}} sections * Wiki tags Highlighting can be configured in <code>Settings โ Configure Kate โ Fonts & Colors โ Highlighting Text Styles</code> and select "Markup/MediaWiki" in the drop-down menu. There is also a highlighting import tool: <code>Settings โ Configure Kate โ Fonts & Colors โ Highlighting Text Styles โ Highlight: โ Import button</code>. Kate dynamically wraps lines. ===gedit=== [[gedit]] is a cross-platform, free software text editor that comes bundled with [[Ubuntu (operating system)|Ubuntu]] Linux by default. A [[GPL]]-licensed MediaWiki syntax highlight mode is shipped by default with ''gedit 3.10'' and newer. For older versions, you can download it at https://github.com/jpfleury/gedit-mediawiki/archive/master.zip, unzip, and copy the language file to the correct folder, or you can run the following in a GNU/Linux shell: * For gedit 2.x: <div style="margin-left:1em;"><syntaxhighlight lang="bash"> wget --output-document=master.zip https://github.com/jpfleury/gedit-mediawiki/archive/master.zip unzip master.zip mkdir -p ~/.local/share/gtksourceview-2.0/language-specs/ cp gedit-mediawiki-master/mediawiki.lang ~/.local/share/gtksourceview-2.0/language-specs/ </syntaxhighlight></div> * For gedit 3.x: <div style="margin-left:1em;"><syntaxhighlight lang="bash"> wget --output-document=master.zip https://github.com/jpfleury/gedit-mediawiki/archive/master.zip unzip master.zip mkdir -p ~/.local/share/gtksourceview-3.0/language-specs/ cp gedit-mediawiki-master/mediawiki.lang ~/.local/share/gtksourceview-3.0/language-specs/ </syntaxhighlight></div> To select the MediaWiki syntax highlight mode, go to the gedit menu ''View > Highlight Mode > Others'' and select ''MediaWiki''. ===NoteTab=== A [http://www.notetab.com/clipbooks/wiki.zip Clip Library plugin] for the [[NoteTab]] (Windows) text editor contains some functions to automate wiki markup. ===SubEthaEdit=== A [http://www.codingmonkeys.de/subethaedit/modes.html#Wikipedia.mode syntax highlighting mode] is available for [[SubEthaEdit]] (macOS) as well. After downloading the mode bundle, drop it in <code>/Library/Application Support/SubEthaEdit/Modes/</code> (system-wide) or <code>~/Library/Application Support/SubEthaEdit/Modes/</code> (user-specific). You may need to create the final two directories by hand. The mode will be automatically selected for files with a .wiki or .Wikipedia extension. ===TextMate=== A "MediaWiki" bundle is available in the [[TextMate]] for [[macOS]] bundle subversion repository. The bundle could ne enabled through the app preference pane GUI by checking a tickbox. To learn how to load this bundle manualy, see the [http://macromates.com/textmate/manual/bundles#getting_more_bundles TextMate manual page] about installing more bundles, or view this [[shell script]] that downloads and installs it. The bundle does syntax highlighting, code completion, and other actions. For [[Sublime Text]] 2 users, note that you may enable this bundle as well, since Sublime Text 2 supports TextMate bundles. ===Sublime Text=== [https://github.com/tosher/Mediawiker Mediawiker] is a Sublime Text package that enables editing MediaWiki pages. More information about the plugin and its configuration can be found in the [https://github.com/tosher/Mediawiker/wiki mediawiker wiki]. For Wikipedia it is necessary to set the ''https'' to true, inserting it in the package global or user configuration. An example configuration for English Wikipedia is the following: <syntaxhighlight lang="json"> "mediawiki_site": { "English wikipedia": { "host": "en.wikipedia.org", "path": "/w/", "pagepath": "/wiki/", "username": "your_username", "password": "your_password", "domain": "", "https": true, "force_login": true }, }, </syntaxhighlight> ===Vedit=== [http://koti.mbnet.fi/pkl/vedit/wiki/wiki_tools.htm Wiki Tools] for [[VEDIT]] contains syntax highlighting, keyboard configuration, User and Tools menus and several macros for inserting and editing wiki tags and for some more complex operations such as add/delete/copy/paste columns in a wiki table. Installation instructions included, as well as instructions for configuring ''It's All Text!'' for Vedit. ===Vim=== Please feel free to contribute improvements to the below scripts, or check the [https://www.vim.org/maillist.php#vim-dev vim-dev list] if anyone has requested the upload of mediawiki.vim Syntax & FileType plugin. If not, request it and/or post the reasons why they are not here. {{as of | 2017 | March}}, it is not in [https://github.com/vim/vim/tree/master/runtime/syntax the Vim source control tree's "syntax/" directory].) The below scripts are also posted in the [http://www.vim.org/scripts/script.php?script_id=1787 vim.org script collection], where they are occasionally updated (but not since 2011-11-17) with newer versions taken from community contributions on this site. Feel free to remind [[User:Mvc|mvc]] to upload a newer copy periodically if those become stale, since they were uploaded from his vim.org account. ====$HOME/.vim/syntax/mediawiki.vim==== To make [[Vim (text editor)|Vim]] support the MediaWiki markup used on Wikipedia (basically syntax highlighting), save the following lines to "<kbd>~/.vim/syntax/mediawiki.vim</kbd>" or "<kbd>vimfiles\syntax\mediawiki.vim</kbd>". If any of the directories above don't exist you may create them (the Unix/Linux command is <kbd>[[mkdir]]</kbd>). A raw mediawiki.vim file for easy downloading exists on GitHub:<br/>https://raw.githubusercontent.com/chikamichi/mediawiki.vim/master/syntax/mediawiki.vim When using Vim in Windows, creating and saving mediawiki.vim in Vim itself is preferable, otherwise the file may break. {{cot|title=File <samp>mediawiki.vim</samp>}} <syntaxhighlight lang="vim"> " mediawiki.vim (formerly named Wikipedia.vim) " " Vim syntax file " Language: MediaWiki, http://www.mediawiki.org/ " Maintainer: This syntax file needs a maintainer in order to ship " with Vim. Please contact [[User:Unforgettableid]] if you want " to volunteer. " Home: http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim " Last Change: 2011 Sep 19 " Credits: [[User:Aepd87]], [[User:Danny373]], [[User:Ingo Karkat]], et al. " " Published on Wikipedia in 2003-04 and declared authorless. " " Based on the HTML syntax file. Probably too closely based, in fact. " There may well be name collisions everywhere, but ignorance is bliss, " so they say. " " To do: plug-in support for downloading and uploading to the server. if !exists("main_syntax") if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let main_syntax = "mediawiki" endif syntax case ignore if v:version >= 700 syntax spell toplevel endif " Mark illegal characters sy match htmlError "[<>&]" " Tags sy region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,@htmlPreproc sy region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,@htmlPreproc sy match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=@htmlPreproc sy region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError sy region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster sy match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster sy match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster sy match htmlTagError contained "[^>]<"ms=s+1 " Allowed HTML tag names sy keyword htmlTagName contained big blockquote br caption center cite code sy keyword htmlTagName contained dd del div dl dt font hr ins li sy keyword htmlTagName contained ol p pre rb rp rt ruby s small span strike sub sy keyword htmlTagName contained sup table td th tr tt ul var sy match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\)\>" " Allowed Wiki tag names sy keyword htmlTagName contained math nowiki references source syntaxhighlight " Allowed arg names sy keyword htmlArg contained align lang dir width height nowrap bgcolor clear sy keyword htmlArg contained noshade cite datetime size face color type start sy keyword htmlArg contained value compact summary border frame rules sy keyword htmlArg contained cellspacing cellpadding valign char charoff sy keyword htmlArg contained colgroup col span abbr axis headers scope rowspan sy keyword htmlArg contained colspan id class name style title " Special characters sy match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" " Comments sy region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError sy match htmlCommentError contained "[^><!]" sy region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc sy region htmlComment start=+<!DOCTYPE+ keepend end=+>+ if !exists("html_no_rendering") sy cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,@htmlPreproc sy region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic sy region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic sy region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic sy region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline sy region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline sy region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop sy region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop sy region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic sy region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic sy region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic sy region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic sy region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold sy region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold sy region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop sy region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop sy region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop sy region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop sy region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline sy region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop sy region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline sy region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline sy region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop sy region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold sy region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop sy region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop sy region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop sy region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop sy region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop sy region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop sy region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop sy region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop endif " No htmlTop and wikiPre inside HTML preformatted areas, because " MediaWiki renders everything in there literally (HTML tags and " entities, too): <pre> tags work as the combination of <nowiki> and " the standard HTML <pre> tag: the content will preformatted, and it " will not be parsed, but shown as in the wikitext source. " " With wikiPre, indented lines would be rendered differently from " unindented lines. sy match htmlPreTag /<pre\>[^>]*>/ contains=htmlTag sy match htmlPreEndTag /<\/pre>/ contains=htmlEndTag sy match wikiNowikiTag /<nowiki>/ contains=htmlTag sy match wikiNowikiEndTag /<\/nowiki>/ contains=htmlEndTag sy match wikiSourceTag /<source\s\+[^>]\+>/ contains=htmlTag sy match wikiSourceEndTag /<\/source>/ contains=htmlEndTag sy match wikiSyntaxHLTag /<syntaxhighlight\s\+[^>]\+>/ contains=htmlTag sy match wikiSyntaxHLEndTag /<\/syntaxhighlight>/ contains=htmlEndTag " Note: Cannot use 'start="<pre>"rs=e', so still have the <pre> tag " highlighted correctly via separate sy-match. Unfortunately, this will " also highlight <pre> tags inside the preformatted region. sy region htmlPre start="<pre\>[^>]*>" end="<\/pre>"me=e-6 contains=htmlPreTag sy region wikiNowiki start="<nowiki>" end="<\/nowiki>"me=e-9 contains=wikiNowikiTag sy region wikiSource start="<source\s\+[^>]\+>" keepend end="<\/source>"me=e-9 contains=wikiSourceTag sy region wikiSyntaxHL start="<syntaxhighlight\s\+[^>]\+>" keepend end="<\/syntaxhighlight>"me=e-18 contains=wikiSyntaxHLTag sy include @TeX syntax/tex.vim unlet b:current_syntax sy region wikiTeX matchgroup=htmlTag start="<math>" end="<\/math>" contains=@texMathZoneGroup,wikiNowiki,wikiNowikiEndTag sy region wikiRef matchgroup=htmlTag start="<ref>" end="<\/ref>" contains=wikiNowiki,wikiNowikiEndTag sy cluster wikiText contains=wikiLink,wikiTemplate,wikiNowiki,wikiNowikiEndTag,wikiItalic,wikiBold,wikiBoldAndItalic " Tables sy cluster wikiTableFormat contains=wikiTemplate,htmlString,htmlArg,htmlValue sy region wikiTable matchgroup=wikiTableSeparator start="{|" end="|}" contains=wikiTableHeaderLine,wikiTableCaptionLine,wikiTableNewRow,wikiTableHeadingCell,wikiTableNormalCell,@wikiText sy match wikiTableSeparator /^!/ contained sy match wikiTableSeparator /^|/ contained sy match wikiTableSeparator /^|[+-]/ contained sy match wikiTableSeparator /||/ contained sy match wikiTableSeparator /!!/ contained sy match wikiTableFormatEnd /[!|]/ contained sy match wikiTableHeadingCell /\(^!\|!!\)\([^!|]*|\)\?.*/ contains=wikiTableSeparator,@wikiText,wikiTableHeadingFormat " Require at least one '=' in the format, to avoid spurious matches (e.g. " the | in [[foo|bar]] might be taken as the final |, indicating the beginning " of the cell). The same is done for wikiTableNormalFormat below. sy match wikiTableHeadingFormat /\%(^!\|!!\)[^!|]\+=[^!|]\+\([!|]\)\(\1\)\@!/me=e-1 contains=@wikiTableFormat,wikiTableSeparator nextgroup=wikiTableFormatEnd sy match wikiTableNormalCell /\(^|\|||\)\([^|]*|\)\?.*/ contains=wikiTableSeparator,@wikiText,wikiTableNormalFormat sy match wikiTableNormalFormat /\(^|\|||\)[^|]\+=[^|]\+||\@!/me=e-1 contains=@wikiTableFormat,wikiTableSeparator nextgroup=wikiTableFormatEnd sy match wikiTableHeaderLine /\(^{|\)\@<=.*$/ contained contains=@wikiTableFormat sy match wikiTableCaptionLine /^|+.*$/ contained contains=wikiTableSeparator,@wikiText sy match wikiTableNewRow /^|-.*$/ contained contains=wikiTableSeparator,@wikiTableFormat sy cluster wikiTop contains=@Spell,wikiLink,wikiNowiki,wikiNowikiEndTag sy region wikiItalic start=+'\@<!'''\@!+ end=+''+ oneline contains=@wikiTop,wikiItalicBold sy region wikiBold start=+'''+ end=+'''+ oneline contains=@wikiTop,wikiBoldItalic sy region wikiBoldAndItalic start=+'''''+ end=+'''''+ oneline contains=@wikiTop sy region wikiBoldItalic contained start=+'\@<!'''\@!+ end=+''+ oneline contains=@wikiTop sy region wikiItalicBold contained start=+'''+ end=+'''+ oneline contains=@wikiTop sy region wikiH1 start="^=" end="=" oneline contains=@wikiTop sy region wikiH2 start="^==" end="==" oneline contains=@wikiTop sy region wikiH3 start="^===" end="===" oneline contains=@wikiTop sy region wikiH4 start="^====" end="====" oneline contains=@wikiTop sy region wikiH5 start="^=====" end="=====" oneline contains=@wikiTop sy region wikiH6 start="^======" end="======" oneline contains=@wikiTop sy region wikiLink start="\[\[" end="\]\]\(s\|'s\|es\|ing\|\)" oneline contains=wikiLink,wikiNowiki,wikiNowikiEndTag sy region wikiLink start="https\?://" end="\W*\_s"me=s-1 oneline sy region wikiLink start="\[http:" end="\]" oneline contains=wikiNowiki,wikiNowikiEndTag sy region wikiLink start="\[https:" end="\]" oneline contains=wikiNowiki,wikiNowikiEndTag sy region wikiLink start="\[ftp:" end="\]" oneline contains=wikiNowiki,wikiNowikiEndTag sy region wikiLink start="\[gopher:" end="\]" oneline contains=wikiNowiki,wikiNowikiEndTag sy region wikiLink start="\[news:" end="\]" oneline contains=wikiNowiki,wikiNowikiEndTag sy region wikiLink start="\[mailto:" end="\]" oneline contains=wikiNowiki,wikiNowikiEndTag sy match wikiTemplateName /{{\s*\w\+/hs=s+2 contained sy region wikiTemplate start="{{" end="}}" keepend extend contains=wikiNowiki,wikiNowikiEndTag,wikiTemplateName,wikiTemplateParam,wikiTemplate,wikiLink sy region wikiTemplateParam start="{{{\s*\d" end="}}}" extend contains=wikiTemplateName sy match wikiParaFormatChar /^[\:|\*|;|#]\+/ sy match wikiParaFormatChar /^-----*/ sy match wikiPre /^\ .*$/ contains=wikiNowiki,wikiNowikiEndTag " HTML highlighting if version < 508 command! -nargs=+ HtmlHiLink hi link <args> else command! -nargs=+ HtmlHiLink hi def link <args> endif if version >= 508 || !exists("did_html_syn_inits") HtmlHiLink htmlTag Function HtmlHiLink htmlEndTag Identifier HtmlHiLink htmlArg Type HtmlHiLink htmlTagName htmlStatement HtmlHiLink htmlSpecialTagName Exception HtmlHiLink htmlValue String HtmlHiLink htmlSpecialChar Special if !exists("html_no_rendering") HtmlHiLink htmlTitle Title HtmlHiLink htmlH1 htmlTitle HtmlHiLink htmlH2 htmlTitle HtmlHiLink htmlH3 htmlTitle HtmlHiLink htmlH4 htmlTitle HtmlHiLink htmlH5 htmlTitle HtmlHiLink htmlH6 htmlTitle HtmlHiLink htmlPreProc PreProc HtmlHiLink htmlHead htmlPreProc HtmlHiLink htmlPreProcAttrName htmlPreProc HtmlHiLink htmlPreStmt htmlPreProc HtmlHiLink htmlSpecial Special HtmlHiLink htmlCssDefinition htmlSpecial HtmlHiLink htmlEvent htmlSpecial HtmlHiLink htmlSpecialChar htmlSpecial HtmlHiLink htmlComment Comment HtmlHiLink htmlCommentPart htmlComment HtmlHiLink htmlCssStyleComment htmlComment HtmlHiLink htmlString String HtmlHiLink htmlPreAttr htmlString HtmlHiLink htmlValue htmlString HtmlHiLink htmlError Error HtmlHiLink htmlBadArg htmlError HtmlHiLink htmlBadTag htmlError HtmlHiLink htmlCommentError htmlError HtmlHiLink htmlPreError htmlError HtmlHiLink htmlPreProcAttrError htmlError HtmlHiLink htmlTagError htmlError HtmlHiLink htmlStatement Statement HtmlHiLink htmlConstant Constant HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic HtmlHiLink htmlItalicBold htmlBoldItalic HtmlHiLink htmlItalicUnderline htmlUnderlineItalic HtmlHiLink htmlUnderlineBold htmlBoldUnderline HtmlHiLink htmlLink Underlined if !exists("html_my_rendering") hi def htmlBold term=bold cterm=bold gui=bold hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline hi def htmlUnderline term=underline cterm=underline gui=underline hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline hi def htmlItalic term=italic cterm=italic gui=italic endif endif " !exists("html_no_rendering") if version < 508 let did_html_syn_inits = 1 endif endif " version >= 508 || !exists("did_html_syn_inits") " Wiki highlighting HtmlHiLink wikiItalic htmlItalic HtmlHiLink wikiBold htmlBold HtmlHiLink wikiBoldItalic htmlBoldItalic HtmlHiLink wikiItalicBold htmlBoldItalic HtmlHiLink wikiBoldAndItalic htmlBoldItalic HtmlHiLink wikiH1 htmlTitle HtmlHiLink wikiH2 htmlTitle HtmlHiLink wikiH3 htmlTitle HtmlHiLink wikiH4 htmlTitle HtmlHiLink wikiH5 htmlTitle HtmlHiLink wikiH6 htmlTitle HtmlHiLink wikiLink htmlLink HtmlHiLink wikiTemplate htmlSpecial HtmlHiLink wikiTemplateParam htmlSpecial HtmlHiLink wikiTemplateName Type HtmlHiLink wikiParaFormatChar htmlSpecial HtmlHiLink wikiPre htmlConstant HtmlHiLink wikiRef htmlComment HtmlHiLink htmlPre wikiPre HtmlHiLink wikiSource wikiPre HtmlHiLink wikiSyntaxHL wikiPre HtmlHiLink wikiTableSeparator Statement HtmlHiLink wikiTableFormatEnd wikiTableSeparator HtmlHiLink wikiTableHeadingCell htmlBold let b:current_syntax = "mediawiki" delcommand HtmlHiLink if main_syntax == "mediawiki" unlet main_syntax endif " vim: set et sts=2 sw=2: </syntaxhighlight> {{cob}} ====$HOME/.vim/ftdetect/mediawiki.vim==== =====Basic filetype detection===== To autodetect files ending in "{{tt|.wiki}}", add the following lines to "<kbd>.vim/ftdetect/mediawiki.vim</kbd>" or "<kbd>vimfiles\ftdetect\mediawiki.vim</kbd>" (or create the file if it doesn't exist): A raw mediawiki.vim file for easy downloading exists on GitHub:<br> https://raw.githubusercontent.com/chikamichi/mediawiki.vim/master/ftdetect/mediawiki.vim {{File title| $HOME/.vim/ftdetect/mediawiki.vim}} <syntaxhighlight lang="vim"> if has("autocmd") au BufRead,BufNewFile *.mw set filetype=mediawiki au BufRead,BufNewFile *.wiki set filetype=mediawiki au BufRead,BufNewFile *.mediawiki set filetype=mediawiki au BufRead,BufNewFile *.wikipedia.org* set filetype=mediawiki au BufRead,BufNewFile *.wikibooks.org* set filetype=mediawiki au BufRead,BufNewFile *.wikimedia.org* set filetype=mediawiki endif </syntaxhighlight> Alternatively, the command "<kbd>:setf mediawiki</kbd>" will temporarily set the syntax for the current file. =====Mozex Firefox extension fix===== If you use the <b>Mozex Firefox extension</b>,<ref name="Mozex">{{cite web |last=Marek |first=Vladimir |title=Mozex |publisher=MozDev |date=2009-12-27 |url= http://mozex.mozdev.org/ |url-status=dead |archiveurl= https://web.archive.org/web/20200708154331/http://mozex.mozdev.org/ |archivedate=2020-07-08}}</ref> <b>Mozex</b> creates a temporary file ending in "{{tt|.txt}}" rather than "{{tt|.wiki}}" so the above autodetection will not work in combination with that add-on. One solution is to have <b>Mozex</b> invoke vim with these arguments: -c "setf mediawiki" A complete editor command can look some thing like that gnome-terminal -e "vim -c 'setf mediawiki' $1" According to the surviving download mirrors of the now-defunct MozDev site, Mozex was last updated on 11 March 2010 (v. 1.9.12),<ref>{{cite web |title=Index of /pub/mirrors/mozdev.org/mozex/ |publisher=ibiblio.org |date=2010-03-11 |url= https://mirrors.ibiblio.org/pub/mirrors/mozdev.org/mozex/ |accessdate=2025-05-03}}</ref> and per this version's install.rdf file, it supports Firefox 3.7.*. Mozex also supports the Mozilla Application Suite,<ref>{{cite web |last=Marek |first=Vladimir |title=Installation |work=Mozex |publisher=MozDev |url=http://mozex.mozdev.org/installation.html |url-status=dead |archiveurl= https://web.archive.org/web/20200602033602/http://mozex.mozdev.org/installation.html |archivedate=2020-06-02}}</ref> its continuation SeaMonkey up to version 1.1.19, [[Classilla]] (for Mac), RetroZilla,<ref>{{cite web |author=rn10950 |title=RetroZilla |publisher=GitHub |date=2024-05-26 |url=https://github.com/rn10950/RetroZilla |accessdate=2024-05-23}}</ref> and further derivatives. =====Adapt to MediaWiki lines without line breaks===== Wikipedia articles often only have line-breaks at the end of each paragraph, a situation Vim by default doesn't handle as other text editors. Save the following lines to "<kbd>~/.vim/ftplugin/mediawiki.vim</kbd>" or "<kbd>vimfiles\ftplugin\mediawiki.vim</kbd>" to make it as you may be used to from Notepad: {{File title| $HOME/.vim/ftplugin/mediawiki.vim}} <syntaxhighlight lang="vim"> " Many MediaWiki wikis prefer line breaks only at the end of paragraphs " (like in a text processor), which results in long, wrapping lines. setlocal wrap linebreak setlocal textwidth=0 " No auto-wrap at all. setlocal formatoptions-=t formatoptions-=c formatoptions-=a formatoptions+=l " Make navigation more amenable to the long wrapping lines. noremap <buffer> k gk noremap <buffer> j gj noremap <buffer> <Up> gk noremap <buffer> <Down> gj noremap <buffer> 0 g0 noremap <buffer> ^ g^ noremap <buffer> $ g$ noremap <buffer> D dg$ noremap <buffer> C cg$ noremap <buffer> A g$a inoremap <buffer> <Up> <C-O>gk inoremap <buffer> <Down> <C-O>gj </syntaxhighlight> =====Additional gimmicks===== Additional to that you may want to save the following lines to "<kbd>~/.vim/ftplugin/mediawiki.vim</kbd>" or "<kbd>vimfiles\ftplugin\mediawiki.vim</kbd>" for some more gimmicks (you may need to put "<kbd>filetype plugin on</kbd>" in your <code>vimrc</code>): <div style="height:auto; overflow:auto;"> {{File title| $HOME/.vim/ftplugin/mediawiki.vim}} <syntaxhighlight lang="vim"> " utf-8 should be set if not already done globally setlocal fileencoding=utf-8 setlocal matchpairs+=<:> " Treat lists, indented text and tables as comment lines and continue with the " same formatting in the next line (i.e. insert the comment leader) when hitting " <CR> or using "o". setlocal comments=n:#,n:*,n:\:,s:{\|,m:\|,ex:\|} setlocal formatoptions+=roq " match HTML tags (taken directly from $VIM/ftplugin/html.vim) if exists("loaded_matchit") let b:match_ignorecase=0 let b:match_skip = 's:Comment' let b:match_words = '<:>,' . \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' endif " Other useful mappings " Insert a matching = automatically while starting a new header. inoremap <buffer> <silent> = <C-R>=(getline('.')==''\|\|getline('.')=~'^=\+$')?"==\<Lt>Left>":"="<CR> " Enable folding based on ==sections== setlocal foldexpr=getline(v:lnum)=~'^\\(=\\+\\)[^=]\\+\\1\\(\\s*<!--.*-->\\)\\=\\s*$'?\">\".(len(matchstr(getline(v:lnum),'^=\\+'))-1):\"=\" setlocal fdm=expr </syntaxhighlight></div> ===== GVim Syntax menu ===== Add in Syntax menu the option Wiki {{File title| $HOME/.vim/synmenu.vim}} <syntaxhighlight lang="vim"> an 50.150.450 &Syntax.WXYZ.Wiki :cal SetSyn("mediawiki")<CR> </syntaxhighlight> ==== vim-mediawiki-editor ==== [https://github.com/aquach/vim-mediawiki-editor vim-mediawiki-editor] can on copy articles directly from vim, display diff between changes version on the server and our etc. ===Notepad++=== [[Notepad++]] is a free text and [[Source code editor|source code editor]] for [[Microsoft Windows]]. It allows users to create their own syntax highlighting scheme; users can customize a new scheme using the mediawiki markup scheme, or [[User:MjolnirPants/mediawiki lang npp|install an existing version]] provided by the Wikipedia user [[User:MjolnirPants|MjolnirPants]]. Notepad++ supports plugins; there is a 2009 mediaWiki plugin for the 32-bit version that can be downloaded at [http://www.cab.i24.cc/projects/wikieditor/ http://www.cab.i24.cc/projects/wikieditor/] ([https://web.archive.org/web/20231001185805/http://www.cab.i24.cc/projects/wikieditor/ Internet Archive]). ===LibreOffice Writer=== The previous methods allow a Wikipedia Edit page to be processed more efficiently. [[LibreOffice Writer|LibreOffice (LO) Writer]] can be used for this purpose; but using LO Writer to convert a formatted document into Wikipedia edit format is also possible. This requires using styles and other LO features, explained in LO Writer Help > MediaWiki Formats; for example the Heading 2 style must be used if a heading is to be enclosed within a pair of "==". This is supported, at least, in LO 5 under Windows 10 with the appropriate 32- or 64-bit [[Java Runtime Environment]] (JRE) present and enabled in LO; the procedure is File > Export > MediaWiki (.txt). See [[Help:WordToWiki]]. ===Offline MediaWiki Code Editor=== [https://wikicodeeditor.wordpress.com Offline MediaWiki Code Editor] is a multilingual freeware offline application programmed in ''AutoHotkey'' script language for those ''Windows''ยฎ users who edit articles in ''Wikipedia'' and other projects of the ''Wikimedia Foundation''. It includes tools and assistants with a simple and intuitive user-friendly Graphical User Interface (GUI) which helps the user to generate much of the ''MediaWiki'' code. Among other gifts the assistants help the user to: {{columns-list|colwidth=20em| *Apply list style *Build links *Split in columns *Insert special characters *Insert inline references *Insert images *Insert image galleries *Insert tables *Browse/Concatenate files *Compare versions of a document *Convert to HTML and preview *Two-windows mode }} The application makes easier and faster the edition of articles, even if the user lacks previous knowledge of the markup rules. It helps to prevent mistakes during the process of edition, and to pay less attention to the sintax. Although the application program was designed for users with no previous knowledge of the ''MediaWiki'' language, it is also useful for experts, once it saves time and reduces the possibility of typing errors. Although is not a visual editor, it offers the possibility to test offline most of your code in your default web browser. This tests simulate the behavior that would show the wiki code in a ''Wikipedia'' page. The installer may be downloaded free from the [https://wikicodeeditor.wordpress.com Offline MediaWiki Code Editor] site. Both the installer and the application interface are available in English, Spanish, German and French. Last update can be downloaded from [https://ln5.sync.com/dl/4f2354260/bjpw49kv-5schka8s-hp489h27-thgbzkue here].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)