Friday, January 11, 2013

Using autocommand to change scrolloff but it is changed in all buffers

Hi,

I have the following autocommand

"set readonly files to autoread
autocmd BufRead,BufNewFile * if &readonly == 1 | setlocal autoread so=0
\ sbo+=ver,hor | endif


I usually set so=2 in my vimrc. After I use vim help the value of so is changed in all buffers to be 0.
I am sure that this autocommand is causing this because if I change so=0 to so=3 then all buffers will have so=3 after I call help.

Am I doing this correctly?

Regards.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: