Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conf files in color

Status
Not open for further replies.

RandyRiegel

Programmer
Joined
Sep 29, 2003
Messages
256
Location
US
I create .conf files for virtual domains that I 'Include' at the bottom of my httpd.conf file. How can I get these files (ex. /etc/httpd/conf/vhosts/mydomain.com.conf) to display in color when editing with 'vi' like my httpd.conf does? Is there a setting somewhere that tells vi which files to use color editing?

randy

 
Hit : to get to the commandline in vim, and type 'set syntax on'. Google for .vimrc or hit and get a sample .vimrc with nifty highlighting.

----
JBR
 
I have put syntax on and it still won't do it with a .conf file I create. I can create c,cpp,pl,etc. and syntax coloring works fine. I've looked at a couple diff examples. I'll keep looking...let me know if I'm still overlooking something.

Randy
 
I have the .vimrc file from in my home directory. I notice the tabs and autoindenting and stuff working. But still one file highlights while another one doesn't, here is a link to a GIF of my screen. The window on the top left is me viewing 'httpd.conf' and the one on the bottom left is me viewing 'randyriegel.conf'. Why would one file be highlighted and one file not be?


Randy
 
When I said highlighted I meant to say "Syntax colored"
 
Found what is going on. The file /usr/share/vim/vim62/filetype.vim contains all the highlight settings for differnt file types and specfic files. I renamed all my config files to a .vhost extension and gave that extention filetype = apache.

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top