Making Autocmd matches buffer's first line

2006-09-20 Thread Fabien Meghazi
Hi all, I have a lot of python files without the .py extensions as I'm using them as commands, those files are scripts in my ~/bin with execute bit set. I set up my editing environment for python files in my .vimrc using autocmd using pattern *.py But I would like these autocmd's to match those

Re: Making Autocmd matches buffer's first line

2006-09-20 Thread Yakov Lerner
On 9/20/06, Fabien Meghazi [EMAIL PROTECTED] wrote: Hi all, I have a lot of python files without the .py extensions as I'm using them as commands, those files are scripts in my ~/bin with execute bit set. I set up my editing environment for python files in my .vimrc using autocmd using pattern

Re: Making Autocmd matches buffer's first line

2006-09-20 Thread Greg Dunn
On 9/20/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 9/20/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 9/20/06, Fabien Meghazi [EMAIL PROTECTED] wrote: Hi all, I have a lot of python files without the .py extensions as I'm using them as commands, those files are scripts in my ~/bin with

Re: Making Autocmd matches buffer's first line

2006-09-20 Thread Charles E Campbell Jr
Yakov Lerner wrote: On 9/20/06, Fabien Meghazi [EMAIL PROTECTED] wrote: But I would like these autocmd's to match those files without .py extensions. My question is : Is it possible to make an autocmd pattern's to match something in the first line's buffer with a regexp eg: (

Re: Making Autocmd matches buffer's first line

2006-09-20 Thread Fabien Meghazi
We typically do it as follows: :au BufReadPost * if getline(1) =~ 'pattern' | do something | endif Thanks all , it works ok Also, one is supposed to put such things in .vim/scripts.vim (or vimfiles\scripts.vim if you're a Windozer) That's why I won't use it. I like to have only