Friday, March 7, 2008

Vimming your way to the top

Here's the Vim syntax file I use for highlighting my to-do list. It's based on the syntax file for YAML.
http://www.vim.org/scripts/script.php?script_id=2599

Benefits:
  • Different colors for lines ending in ':' or starting with '*' or '{'
  • Assign keywords to be automatically highlighted, like important locations, coworkers' names, customers, taquerias, etc.
  • Start sections with a line of underscores and a heading beginning with the '{' character. The heading stands out (red with GVim's "desert" color scheme), and you can jump between sections just like C blocks using ]] and [[ keystrokes.
  • Ordinary text (i.e. not specifically formatted for this syntax) looks sane.
Normally I have a line in my .vimrc assigning the filetype "todolist" to the file where I keep my permanent todolist, but another way to add this highlighting to a text file is to add vim: ft=todolist to the end of a file. It's harmless.

Update (4/2/09): I uploaded the script to vim.org, where it will be easier to track and update.

0 comments: