Friday, May 28, 2010

Reviewing in vim

Bugzilla's review interface is poor. I find a mild improvement is possible by copying the review text into an editor and reviewing it there. One of things that makes this experience better is syntax highlighting. Here's a modification of vim's diff highlighting script that works with quoted patches. Adding the following to one's .vimrc will get it used for .review files:
au BufNewFile,BufRead *.review setf review

4 comments:

  1. Shouldn't you change the metadata at the top of that file?

    I did the copy and paste thing for a long time. Then I finally broke down and installed the It's All Text! extension, even though it's rough. It's one of those extensions that adds a menupopup to the Tools menu, even though there's not really any "primary" UI to show. (Preferences don't qualify.) The editor launcher doesn't take a command-line; it takes a file, which should be executable. Since I'm most used to running Vim from the terminal, my preference would have been gnome-terminal -x vim. Instead, you need to create a wrapper shell script to do this, and point the config there.

    I wish somebody would just get around to making an embeddable terminal emulator in Mozilla. I'm looking at you, ActiveState!

    ReplyDelete
  2. How about: http://code.google.com/p/pcmanfx/

    Quote:
    "An extension specifically designed for Telnet/BBS browsing. It let you use telnet:// inside Firefox tabs.

    Features

    * Entirely written in Javascript. No additional plugin is needed.
    * Cross-platform, can be used on all platforms which Firefox supports.
    * Seamless integration with Firefox
    * Reasonable execution speed
    * Good render quality
    * Can render one double-byte characters with two different colors
    * Actively developed"
    EndQuote:

    ReplyDelete
  3. The "canonical" place for that autocommand is in ~/.vim/filetype.vim (on Unix) or $HOME/vimfiles/filetypes.vim (in Vim terminology on Windows). Create the directory if it doesn't exist. If the file itself doesn't exist, create it as follows:

    " Autocommands to detect filetypes unknown
    " to Vim by default
    augroup filetypedetect
       au BufNewFile,BufRead *.review setf review
    augroup END

    This has the advantage that this autocommand will be removed by ":filetype off" and added back by ":filetype on".

    ReplyDelete
  4. As far as terminal emulators/editors go, there's also EmbeddedEditor, but it's up to fx3.0 only and there's a pretty crazy security issue with it that would allow you to execute arbitrary stuff.

    ReplyDelete