Syntax highlighting

From DavinciWiki
Jump to: navigation, search

Contents

Summary

When writing scripts for Davinci, you may find it useful to work in an editor with syntax highlighting. Syntax files (which contain the keywords for Davinci) for some text editors are provided below.

Last updated

These files were uploaded on July 15, 2011. Any functions added since then would not be listed in the syntax files.

PSPad

  • Save File:Davinci.INI to your PSPad syntax directory, which by default is C:\Program Files\PSPad\Syntax.
  • In PSPad, you will have to go to Settings → Highlighters Settings and add Davinci.

RJ TextEd

  • Save File:Davinci.ini, File:Davinci.ssx, and File:Davinci.syx to the RJ TextEd syntax folder. In Windows Vista, this is [your user directory]\AppData\Roaming\RJ TextEd\Syntax.
  • To enable the syntax files, open RJ TextEd and go to Environment → Add-ons → Highlighters and Activate Davinci.
  • To enable the color scheme, you may also need to go to Environment → Options → Highlighters and Import the file Davinci.ssx.

Vim

Notes: The file and instructions given here are known to work for gVim on systems running two different flavors of Unix: CentOS and Ubuntu. Minor tweaks may be needed for some configurations - for instance, if your .vim directory is not in your home directory. You may need to create files with the specified names and locations, as the settings files mentioned here may not exist yet on your system, even if you have some flavor of Vim installed.

Syntax

  • Save File:Davinci.vim to your .vim directory.
  • In order to have Vim recognize files with extensions typically used by Davinci, add the following lines to mysyntax.vim (which should be in your .vim directory):
au BufRead,BufNewFile *.dv set filetype=Davinci
au BufRead,BufNewFile *.dvlog set filetype=Davinci
au BufRead,BufNewFile *.dvrc set filetype=Davinci
au! Syntax Davinci source ~/.vim/Davinci.vim
  • If needed, add the following lines to .vimrc (which should be in your home directory):
let mysyntaxfile = "~/.vim/mysyntax.vim"
syntax on

set runtimepath=~/.vim,$VIMRUNTIME

Colors (optional)

The syntax file provided above should work with any color scheme, but it was written with this color scheme File:lab.vim in mind. To use this color scheme, save it in ~/.vim/colors/ and, if you want it to be the default color scheme, add the following line to mysyntax.vim:

colors lab
Personal tools