Saturday, September 24, 2011

Re: Highlight

2011/9/24 Lennart Andersen <lennartka@rogers.com>:
> * Christian Brabandt <cblists@256bit.org> [2011-09-22 10:13+0200]
>> On Thu, September 22, 2011 8:05 am, Lennart Andersen wrote:
>> > Could some tell me how I get syntax highlight on log files in the /var/log
>> > dir? Such as
>> > message, syslog, so on files with no extension.

Hi, Christian.

According to what I see with MacVim, the only file that is highlighted from the
/var/log is a set of *messages* files. What you need to do is add an auto
command in your 'vimrc' file to including the LOGs you whant to highlight. Or,
more basically you can set the file type after you open that file.

For example, I added the following to my `vimrc' file:

au BufNewFile,BufRead /var/log/*.log setf messages

Any file from `/var/log' with `.log' extension will be highlighted as
`messages' file type.

Regards,
Alessandro Antonello

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment