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 a default file extension names, for example, Javascript syntax file supports *.js extension. If you happen to use different extension conflicting with another default syntax file as in putting Javascript in *.html file than you MUST source in with command :so $VIM/syntax/javascript.vim. Best method is 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