Some .conf files have a lot of comments and parameters in them like so,

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

It gets difficult to look for only the parameters among the plethora of comments, so is there some text editor that can highlight the comments in dark grey so that the real parameters stand out?

  • Just to be sure. Do you want to open the conf file via a GUI like kate or gedit or do you want to do it in terminal like nano, vim, pico, etc..? – Luis Alvarado Dec 31 '10 at 3:47
  • Yes, in a GUI editor.. – Zabba Dec 31 '10 at 5:43

Emacs does automatic syntax highlighting for .conf files. It's possible you won't like (I don't!) its colors for .conf files, so check https://stackoverflow.com/questions/1076503/change-emacs-syntax-highlighting-colors and you'll be able to change it to your tastes. And it can do it the same way with a GUI or in console mode.

GEdit also does it, but not automatically. Manually set the highlighter (click on "Plain Text" on the status bar, or through View > Highlighter) to awk or sh, and you'll have a similar effect.

I'm just suggesting these two. There are many other editors that will do what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.