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

+ Reply to Thread
Results 1 to 3 of 3

font-lock-add-keywords in VIM

  1. Default 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


  2. Default 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.


  3. Default 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.



+ Reply to Thread

Similar Threads

  1. Re: Can't change font, character count says 0, but font IS USED in doc
    By Application Development in forum Adobe Indesign
    Replies: 0
    Last Post: 11-29-2006, 04:30 PM
  2. Trapping Missing Font or Font Type on Serverwhile importing Tagged Text file
    By Application Development in forum Adobe Indesign
    Replies: 0
    Last Post: 10-19-2006, 07:52 AM
  3. Can anyone help me convert mac postscript font to pc truetype font
    By Application Development in forum Adobe Typography
    Replies: 18
    Last Post: 08-28-2006, 03:26 PM
  4. Change font and font size in .vimrc ?
    By Application Development in forum Editors
    Replies: 1
    Last Post: 08-10-2006, 07:51 AM
  5. font-lock strings in gnuplot-mode
    By Application Development in forum Graphics
    Replies: 5
    Last Post: 09-13-2005, 01:36 AM