LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Vim Syntax Highlighter (http://www.linuxquestions.org/questions/linux-software-2/vim-syntax-highlighter-797785/)

carlosinfl 03-25-2010 07:33 AM

Vim Syntax Highlighter
 
Is there a method or way to "update" Vim's syntax highlighter manually? I appear to have a very updated version of Vim on both Debian & Arch Linux but I notice that on both servers on the identical configuration file for Postfix MTA (main.cf) I have a parameter that shows up in 'white' which usually means 1 or 2 things:

1. I have a typo somewhere in my parameter.
2. The parameter is not recognized by Postfix and useless

However in this case it is neither of the two above however it stands out in the configuration file because it's not in color. It's the only one that is white text. I verified the command / parameter is valid:

Link

The parameter is:

Code:

smtpd_tls_security_level = may
Is there a way to update Vim to highlight the " smtpd_tls_security_level" parameter in the configuration file when opened with Vim? Do I need to update the syntax highlighter for this to have the desired effect?

**I know this issue is purley cosmetic but as an administrator I find it annoyong to have to waste time and research if a configuration parameter is valid or not. I rely on Vim's color syntax highlighting to tell me when I make a overlooked mistake. I do know that Postfix is happy with the current configuration as I can see it being executed in the program**:

Code:

postconf -n | grep "smtpd_tls_security_level"
smtpd_tls_security_level = may


smoker 03-25-2010 08:06 AM

Have a read of this :
http://www.faqs.org/docs/Linux-HOWTO...l#color_syntax

You can find the syntax files below /usr/share/vim/*/syntax

The * is because you may have a vim version directory, like mine is /usr/share/vim/vim63/syntax
but you may not and just need /usr/share/vim/syntax

Find the relevant syntax file (pfmain.vim) and add your expression to it.

I wouldn't rely on vim to tell you whether a parameter is valid, it's only an editor not a postfix debugger.

carlosinfl 03-25-2010 08:14 AM

Thank you very much. I had to 'cd' into /usr/share/vim/vim72/syntax.

There I added it into 'pfmain.vim' and it worked like a charm!


All times are GMT -5. The time now is 06:07 AM.