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 &ro | %s/[ \t\r]\+$//e | endif

should do the trick.  ":help expr-option" shows the different ways you
can access options in expressions.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: Digital signature

Reply via email to