Next Previous Contents

3. Color Syntax init files

Instead of using "Syntax" menu you can also manually source in the syntax file. Edit the file with gvim and at : (colon) command give 'so' command. For example -


        gvim foo.pc
        :so $VIM/syntax/esqlc.vim

The syntax source files are at /usr/share/vim/syntax/*.vim. Vim supports more than 120 different syntax files for different languages like C++, PERL, VHDL, JavaScript,...and so on!!

Each syntax file supports one or more default file name extensions, for example, JavaScript syntax file supports the *.js extension. If you happen to use an extension that conflicts with another default syntax file (such as adding JavaScript to a *.html file) than you can source in the additional syntax file with the command :so $VIM/syntax/javascript.vim. To avoid all of this typing, you can create a soft link like -


        ln -s $VIM/syntax/javascript.vim js
        gvim foo.html  (... this file contains javascript functions and HTML)
        :so js


Next Previous Contents