viki wrote:
> I have au rule for Makefiles:
>
> au BufWritePre Makefile :something
>
> Now it turns out that Makefiles in directory $PDIR and $PDIR/**
> shall be excluded from this rule.
> How do I express such exception in "au" rule ?
You can test the path in the autocommand itself: e.g.,
au BufWritePre Makefile
\ :if expand('<afile>:p') !~ '^' . $PDIR . '\(/\f*\)\?/Makefile$'
\ |echomsg "Do something to file: " . expand('<afile>:p')|endif
Note the use of the :p qualifier on <afile> to ensure that the test is
performed on the full path. Alternatively, you could put the tests
within a function if your logic is more complex...
Brett Stahlman
>
> Thanks
> Viki
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---