|
[ Home - Syntax Files - Rxvt - Dead Keys - Compiling - Ispell - Download ]
First, you need a .vimrc
file in your home directory. You can use
mine as a guide if you want. The important lines with respect to syntax
highlighting are
" get syntax highlighting let mysyntaxfile = "$VIM/mysyntax/mysyntax.vim" syntax onThis assumes that you did set the environment variable
VIM
to
point to the vim installation directory. In my case this directory is a
subdirectory of my home directory, but most of the files and directories there
are symbolic links to the real vim install directory ($VIM/syntax for example
points to /usr/local/vim/syntax).
Now you have to create the mysyntax.vim file. I use it to declare the additional colors I can use in rxvt plus I added some lines such that instead of the default syntax color files my own syntax files are loaded. In the latter case you may also want to add some new filetypes as shown in my mysyntax.vim file.
That's all there is to it. Now you should get a colorful screen when you open a java source file for example.
If you want to create a new syntax file for a new language, you need to do the following:
au BufRead,BufNewFile *.newl set filetype=newlangAn entry to read your syntax file is needed too:
au! Syntax newlang source $VIM/newlanguage.vim(make sure that the path is correct).
:help syntaxin vim.
(C) 1997-2001 Claudio Fleiner