2008/10/7 Bob Hiestand <[EMAIL PROTECTED]>:
>
> On Tue, Oct 7, 2008 at 5:48 AM, Efraim Yawitz <[EMAIL PROTECTED]> wrote:
>>
>> On Mon, Oct 6, 2008 at 6:41 PM, Tony Mechelynck
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> On 06/10/08 13:05, Efraim Yawitz wrote:
>>>> Why doesn't the following work to make all files in a given directory
>>>> have a certain syntax highlighting?
>>>>
>>>> :au BufRead /some/directory set syn=somesyntax
>>>
>>> You should set 'filetype' rather than 'syntax'. What happens is (I
>>> think) the following:
>>
>> I checked this also, and it also wasn't working.  Then I realized what
>> the problem was.  I had done a :cd (actually a :lcd) to
>> /some/directory and opened the file without the full path, so the
>> match wasn't working.  When opening with the full path, set syn worked
>> fine.  Now the question is, how do I get this match to work without
>> the full path?
>
> You could do something like the following (untested):
>
> :auto BufRead * if expand('%') =~ '^/some/directory'|set ft=somefiletype|endif

Wouldn't expand('%:p') be better?

:help expand()

Al

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to