Tuesday, May 4, 2010

Color syntax for local variables and user defined functions.

I have enabled syntax coloring with gvim and it works fine with 'c' keywords
like 'if', 'else' etc.
However it does not work with a function or local variable defined by me. I
have built 'tags' file again after modifying my files to no avail. What shud
I do to enable color syntax for local variables, user defined functions etc.

Thanks in advance.

Here is a look at my .vimrc

"set tags=/vob/common_platform/dev/tags,/vob/dapivtt/tags
set tags=/vob/dapivtt/tags
syn on
"set guifont=Times_New_Roman:h28:cANSI
set warn
set showmode
set nocp
"filetype plugin on
"set Tlist_Ctags_Cmd=/vob/dapivtt/tags

" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other
things.
" Author: Shailesh
"

" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
set nocompatible
" use indentation of previous line
set autoindent
" use intelligent indentation for C
set smartindent
" configure tabwidth and insert spaces instead of tabs
set tabstop=4 " tab width is 4 spaces
set shiftwidth=4 " indent also with 4 spaces
set expandtab " expand tabs to spaces
" wrap lines at 120 chars. 80 is somewaht antiquated with nowadays
displays.
set textwidth=120
" turn syntax highlighting on
set t_Co=256
syntax on
colorscheme summerfruit256
" turn line numbers on
set number
" highlight matching braces
set showmatch
" intelligent comments
set comments=sl:/*,mb:\ *,elx:\ */

" Keyboard mappings
map <F1> :previous<CR> " map F1 to open previous buffer
map <F2> :next<CR> " map F2 to open next buffer

" Install OmniCppComplete like described on
http://vim.wikia.com/wiki/C++_code_completion
" This offers intelligent C++ completion when typing '.' '->' or <C-o>
" Load standard tag files
set tags+=~/.vim/tags/cpp
set tags+=~/.vim/tags/gl
set tags+=~/.vim/tags/sdl
set tags+=~/.vim/tags/qt4

" Install DoxygenToolkit from
http://www.vim.org/scripts/script.php?script_id=987
let g:DoxygenToolkit_authorName="Gerhard Gappmeier
<gerhard.gappmeier@ascolab.com>"

" Enhanced keyboard mappings
"
" in normal mode F2 will save the file
nmap <F2> :w<CR>
" in insert mode F2 will exit insert, save, enters insert again
imap <F2> <ESC>:w<CR>i
" switch between header/source with F4
map <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>
" recreate tags file with F5
map <F5> :!ctags -R ?c++-kinds=+p ?fields=+iaS ?extra=+q .<CR>
" create doxygen comment
map <F6> :Dox<CR>
" build using makeprg with <F7>
map <F7> :make<CR>
" build using makeprg with <S-F7>
map <S-F7> :make clean all<CR>
" goto definition with F12
map <F12> <C-]>
" in diff mode we use the spell check keys for merging
if &diff
" diff settings
map <M-Down> ]c
map <M-Up> [c
map <M-Left> do
map <M-Right> dp
map <F9> :new<CR>:read !svn diff<CR>:set syntax=diff buftype=nofile<CR>gg
else
" spell settings
":setlocal spell spelllang=en
" set the spellfile - folders must exist
"set spellfile=~/.vim/spellfile.add
map <M-Down> ]s
map <M-Up> [s
endif

--
View this message in context: http://old.nabble.com/Color-syntax-for-local-variables-and-user-defined-functions.-tp28447762p28447762.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: