detecting a readonly file and not doing something...

2006-05-30 Thread Robert Hicks
I currently have this: autocmd BufEnter * :%s/[ \t\r]\+$//e get rid of the pesky ^M However, it gives me an error I have to enter through when I open a readonly file. I want to be able to turn that off when the file is RO. :Robert

Re: detecting a readonly file and not doing something...

2006-05-30 Thread James Vega
On Tue, May 30, 2006 at 09:04:15AM -0400, Robert Hicks wrote: I currently have this: autocmd BufEnter * :%s/[ \t\r]\+$//e get rid of the pesky ^M However, it gives me an error I have to enter through when I open a readonly file. Something along the lines of autocmd BufEnter * :if

Re: detecting a readonly file and not doing something...

2006-05-30 Thread James Vega
On Tue, May 30, 2006 at 09:16:38AM -0400, James Vega wrote: On Tue, May 30, 2006 at 09:04:15AM -0400, Robert Hicks wrote: I currently have this: autocmd BufEnter * :%s/[ \t\r]\+$//e get rid of the pesky ^M However, it gives me an error I have to enter through when I open a

Re: detecting a readonly file and not doing something...

2006-05-30 Thread Robert Hicks
James Vega wrote: On Tue, May 30, 2006 at 09:16:38AM -0400, James Vega wrote: On Tue, May 30, 2006 at 09:04:15AM -0400, Robert Hicks wrote: I currently have this: autocmd BufEnter * :%s/[ \t\r]\+$//e get rid of the pesky ^M However, it gives me an error I have to enter through when I