Editing the wiki with Vim (or $EDITOR)

hide

Matthew and I (Luke) have been pairing while editing wiki pages quite a bit lately. We've been enjoying the process of using my simple tool wikedit which comes with the Socialtext-Resting-Utils package. Then, I made it even better by creating a syntax highlighting file. So now, we edit our wiki pages quickly and pleasurably using vim in full color.

(It's funny, after viewing the file in vim, the black and white rendered view doesn't look as nice)

See also: Wikedit Improvements

Socialtexters Howto

Setup

  1. setup/sync stconfig (this should give you stedit and the vim scripts)
  2. cpan install Socialtext::Resting::Utils
  3. run wikedit to view the usage and how to setup defaults

Usage
stconfig includes a useful wrapper of wikedit called stedit that defaults the server to staging, and adds a -p switch to use prod.

# Edit a page on corp
stedit 'People Directory'

# Edit a page in dev-tasks
stedit -w dev-tasks spike_summaries

# Edit a page on appliance-project
stedit -p -w appliance-project appliance_customization_iteration

The latest Socialtext-Resting-Utils (0.05) saves temp files as .wiki, so you can put a rule in your .vimrc to load wiki syntax highlighting like so:

autocmd BufRead *.wiki set ft=wiki

I've attached the vim highlighting file to this page (hopefully). Drop it into ~/.vim/syntax/wiki.vim.

The latest version is kept in our open stconfig repository here: https://repo.socialtext.net:8999/svn/stconfig/trunk/.vim/syntax/wiki.vim


2008/01/28: I have uploaded an improved version of the syntax highlighting definitions, along with an ftplugin that sets some useful buffer-local options. Ironically, Luke's original syntax file was adapted from my syntax highlighting for Flexwiki. This new file is also available at Vim.org and my own website. -- George V. Reilly

I just added these files to our subversion repo --lukec



Tags

    There are no tags for this page.

Attachments

Click this button to save this page to your computer for offline use. Created by Luke Closs on Jan 9 9:59pm. Updated by Luke Closs on Feb 6 4:44pm. (12 revisions, 1,822 views)