On Thu, Mar 25, 2010 at 04:48, Joshua Swink <jsw...@ucmerced.edu> wrote:
> I'm wondering why the word "template" is highlighted in vim in my Java
> code. Apparently "template" is not a keyword in the Java language. Vim
> is highlighting the word with a bright red background, the same as if
> I'd entered a syntax error.

Because "template" is a widely used C++ keywords but is not used in
Java.  In order to keep you from misusing some C++ keywords in Java,
Vim highlights those keywords as syntax error by default.  They are:

  auto delete extern friend inline redeclared register signed sizeof
struct template typedef union unsigned operator

If you really want to use them, say, as variable names, you can
disable this feature by adding:

  let java_allow_cpp_keywords = 1

To your .vimrc

> I'm using vim 7.2 as provided by Ubuntu 9.10's vim-gnome package
> group. It wasn't highlighted prior to upgrading from Ubuntu 9.04 to
> 9.10
>
> $ vi --version
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 21 2009 11:19:54)
> Included patches: 1-245
> Compiled by bui...@rothera.buildd
> Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
> +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
> +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
> +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
> +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
> +float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand
> +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
> +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm
> -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte
> +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript
> +printer +profile +python +quickfix +reltime +rightleft +ruby +scrollbind
> +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
> +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects 
> +title
>  +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
> +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
> +xsmp_interact +xterm_clipboard -xterm_save
> ...
>
> Josh
>
> --
> 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
>
> To unsubscribe from this group, send email to 
> vim_use+unsubscribegooglegroups.com or reply to this email with the words 
> "REMOVE ME" as the subject.
>

-- 
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

To unsubscribe from this group, send email to 
vim_use+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to