When I open most common filetypes in vim, the filetype syntax colours appear as expected. But when I try to open /etc/procmailrc it just appears as all the one colour, as if the filetype is not recognised.
In an attempt to get vim to automatically set the ft for it, I added:
#EOF vim: set ft=procmail :
to the end of the file. But it still will not recognise it.
If I manually type :set ft=procmail in the open file, the syntax colours do display correctly.
On 2009-10-13, Troy Piggins <usenet-0...@piggo.com> wrote:
> When I open most common filetypes in vim, the filetype syntax > colours appear as expected. But when I try to open > /etc/procmailrc it just appears as all the one colour, as if the > filetype is not recognised.
> In an attempt to get vim to automatically set the ft for it, I > added:
> #EOF vim: set ft=procmail :
Could it be, that modelines are disabled for you? Check your modeline settings: :verbose set ml? mls?
Anyway, it seems filetype.vim only detects .procmail and .procmailrc as filetypes. There a couple of possibilities to have that fixed without modelines. See help new-filetype.
The easiest solution is to create ~/.vim/ftdetect/procmail.vim and enter au BufNewFile,BufRead procmailrc setfiletype procmail and restart vim
You can also create your own filetype.vim file in your ~/.vim directory and enter something like
if exists("did_load_filetypes") finish endif augroup filetypedetect au! BufRead,BufNewFile procmailrc setfiletype procmail augroup END
> On 2009-10-13, Troy Piggins <usenet-0...@piggo.com> wrote: >> When I open most common filetypes in vim, the filetype syntax >> colours appear as expected. But when I try to open >> /etc/procmailrc it just appears as all the one colour, as if the >> filetype is not recognised.
>> In an attempt to get vim to automatically set the ft for it, I >> added:
>> #EOF vim: set ft=procmail :
> Could it be, that modelines are disabled for you? Check your modeline > settings: >:verbose set ml? mls?
:verbose set ml? mls? nomodeline modelines=5
I guess not. Checked the help and it seems modeline default is ON for normal users, OFF for root. I tried opening /etc/procmailrc as a normal user and indeed it does syntax colour correctly, so that must be it. I guess.
> Anyway, it seems filetype.vim only detects .procmail and .procmailrc as > filetypes. There a couple of possibilities to have that fixed without > modelines. See help new-filetype.
> The easiest solution is to create ~/.vim/ftdetect/procmail.vim and enter > au BufNewFile,BufRead procmailrc setfiletype procmail > and restart vim
> You can also create your own filetype.vim file in your ~/.vim directory > and enter something like
> if exists("did_load_filetypes") > finish > endif > augroup filetypedetect > au! BufRead,BufNewFile procmailrc setfiletype procmail > augroup END
> See the help, for more possibilites.
Thanks very much for the options, Christian. Certainly should be able to sort it out from here. Thanks.