font-lock-add-keywords in VIM - Editors
This is a discussion on font-lock-add-keywords in VIM - Editors ; Hi,
I'd like to add my own keywords to vim (like FIXME, WARNING showing in
lime, etc).
I just did in emacs, and wondered if I could do the same in vim.
The main problem is: they must have "higher ...
-
font-lock-add-keywords in VIM
Hi,
I'd like to add my own keywords to vim (like FIXME, WARNING showing in
lime, etc).
I just did in emacs, and wondered if I could do the same in vim.
The main problem is: they must have "higher priority" than comments, so
they will be highlighted in comments (since i'm compiling the file,
this is a must)
Any ideas?
Tks
-
Re: font-lock-add-keywords in VIM
jrcapa wrote:
> Hi,
> I'd like to add my own keywords to vim (like FIXME, WARNING showing in
> lime, etc).
> I just did in emacs, and wondered if I could do the same in vim.
> The main problem is: they must have "higher priority" than comments, so
> they will be highlighted in comments (since i'm compiling the file,
> this is a must)
For what language? You want something like this in a new file
~/.vim/syntax/python.vim (or wherever your .vim directory is on your
platform):
syn keyword pythonTodo FIXATION FIXIFY NEEDS_DONE
For C, change python.vim to c.vim and pythonTodo to cTodo, for java
make it java.vim and javaTodo, etc.
If you want it everywhere, what exactly are you doing it for? The
biggest sledgehammer is something in your vimrc like:
match ErrorMsg /\<FIXATION\>/
match ErrorMsg /\<FIXIFY\>/
....
but there are probably better solutions depending on what you want.
-
Re: font-lock-add-keywords in VIM
I thought it should be global, but then I started looking in the syntax
files and found out that most of them already have todo, fixme, etc....
and there's even a highlighting group named "Todo"!
Problem solved! Tks
sjdevnull@yahoo.com escreveu:
> jrcapa wrote:
> > Hi,
> > I'd like to add my own keywords to vim (like FIXME, WARNING showing in
> > lime, etc).
> > I just did in emacs, and wondered if I could do the same in vim.
> > The main problem is: they must have "higher priority" than comments, so
> > they will be highlighted in comments (since i'm compiling the file,
> > this is a must)
>
> For what language? You want something like this in a new file
> ~/.vim/syntax/python.vim (or wherever your .vim directory is on your
> platform):
>
> syn keyword pythonTodo FIXATION FIXIFY NEEDS_DONE
>
> For C, change python.vim to c.vim and pythonTodo to cTodo, for java
> make it java.vim and javaTodo, etc.
>
> If you want it everywhere, what exactly are you doing it for? The
> biggest sledgehammer is something in your vimrc like:
>
> match ErrorMsg /\<FIXATION\>/
> match ErrorMsg /\<FIXIFY\>/
> ...
>
> but there are probably better solutions depending on what you want.
Similar Threads
-
By Application Development in forum Adobe Indesign
Replies: 0
Last Post: 11-29-2006, 04:30 PM
-
By Application Development in forum Adobe Indesign
Replies: 0
Last Post: 10-19-2006, 07:52 AM
-
By Application Development in forum Adobe Typography
Replies: 18
Last Post: 08-28-2006, 03:26 PM
-
By Application Development in forum Editors
Replies: 1
Last Post: 08-10-2006, 07:51 AM
-
By Application Development in forum Graphics
Replies: 5
Last Post: 09-13-2005, 01:36 AM