Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-25-2010, 07:33 AM   #1
Senior Member
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Question 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 ( 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:


The parameter is:

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

postconf -n | grep "smtpd_tls_security_level"
smtpd_tls_security_level = may
Old 03-25-2010, 08:06 AM   #2
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
Have a read of this :

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.

Last edited by smoker; 03-25-2010 at 08:07 AM.
Old 03-25-2010, 08:14 AM   #3
Senior Member
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
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!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vim syntax highlighting Gortex Programming 1 08-18-2008 05:43 PM
VIM Syntax Highlighting JMJ_coder Programming 3 03-05-2008 04:37 PM
[SOLVED] vim without syntax highlighting lord_didger Debian 5 11-18-2006 01:29 PM
How do I get coloured syntax in ViM? impulse() Linux - Software 2 09-26-2006 09:56 PM
Vim syntax highlighting NSKL Linux - Software 2 11-09-2002 02:39 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration