open encyclopedia * Article Search: * *
*
*

Wikipedia: Text editor support

From open-encyclopedia.com - the free encyclopedia.

Many text editors provide special features for editing source code, which are applicable for editing wiki-markup. The most common and useful feature is syntax highlighting, which alters the appearance of syntactic elements to make them stand out from the rest of the text. Below are files for adapting Emacs, Vim, jEdit, Kate, and SubEthaEdit to wikipedia markup.

Contents

Tips for all editors

If you are using the Mozilla and Mozilla Firefox browsers, it is possible to configure an external editor for editing wikipedia articles without copying and pasting them from the browser's text area. Just download the "MozEx" extension at http://mozex.mozdev.org/. This allows you to edit any text area in your favorite editor by right-clicking.

The "MozEx" extension doesn't work properly on Mozilla Firefox 1.0. See http://www.emacswiki.org/cgi-bin/wiki/FireFox for a work around.

There are also a couple of command line tools that allow you to download articles, edit them using your favorite text editor, and upload the edited articles back into the Wikipedia. This bypasses the need for a web browser. These are:

Emacs

There are a couple of Emacs major modes available for editing wikipedia articles:

  • wikipedia-mode.el is a simple major mode that mostly provides syntax highlighting for wikipedia markup.
  • wikipedia.el is a much more advanced major mode which provides WYSIWYG editing of wikipedia articles. Note, however, that it is developed using the current CVS version of GNU Emacs, and may not be compatible with older versions. It is also in the alpha stage of development, so use it at your own risk.

Vim

To make Vim support wikipedia markup, save wikipedia.vim to your "syntax" directory. By default, this directory is "~/.vim/syntax" on a Unix system, and "C:\Program Files\Vim\vimfiles\syntax" on a Windows system.

To autodetect files ending in ".wiki", add the following lines to ".vim/filetype.vim" or "vimfiles\filetype.vim" (or create the file if it doesn't exist):

augroup filetypedetect
au BufNewFile,BufRead *.wiki setf Wikipedia
augroup END

Alternatively, the command "set syn=Wikipedia" will temporarily set the syntax for the current file.

Wikipedia articles often only have line-breaks at the end of each paragraph, a situation Vim is not designed for. The following lines added to your ".vimrc" or "_vimrc" file will make it much easier to edit such files:

set textwidth=0
set linebreak
map <Up> gk
map <Down> gj
imap <Up> <C-O>gk
imap <Down> <C-O>gj

Please feel free to edit wikipedia.vim and upload an improved copy.

jEdit

For jEdit there is a plugin available at http://www.djini.de/software/wikipedia/ . Apart from providing syntax highlighting for wikipedia markup, it can communicate directly with the Wikipedia website using the HttpClient component from the Jakarta Project.

Kate

For Kate, rules for syntax highlighting are provided by the XML file de:Media:Wikimedia.xml. It recognizes HTML tags and entities, wiki control characters, links, section titles, tables and <nowiki> sections.

SubEthaEdit

A syntax highlighting mode is available for SubEthaEdit as well. After downloading the mode bundle, drop it in /Library/Application Support/SubEthaEdit/Modes/ (system-wide) or ~/Library/Application Support/SubEthaEdit/Modes/ (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.

de:Wikipedia:Texteditor-Unterstützung pt:Wikipedia:Como editar com um editor externo

Contribute Found an omission? You can freely contribute to this Wikipedia article. Edit Article
Copyright © 2003-2004 Zeeshan Muhammad. All rights reserved. Legal notices. Part of the New Frontier Information Network.