> I guess it's a simple thing but couldn't find a definite answer yet.
> Is there a way to make commands such as
>
> syn off
> set foldmethod=expr
>
> local in a sense that they should only effect the window in which they
> are issued?

1. Frist, 'set foldmethod=' is already local to window, so there's no
problem.

2. 'syn off' is global, but if you, instead of 'syn off' do 'set filetype='
(set filetype to empty), which is window-local, you'll get equivalent
result.
Does this work for you ?

Thanks for the reply, actually these 2 commands are just examples from
what I really would like to do. In more detail, I have a function:

function! ReFold()
   syn off | syn on
   set foldmethod=expr
   set foldexpr=0
   syn region myFold start='{' end='}' transparent fold
   syntax sync fromstart
   set foldmethod=syntax
   echo
endfunction

And whenever I call this function in a window it also effects the
other windows. So my real question (sorry if I should have explained
it better in the first email) is how to make the function ReFold act
locally.

Reply via email to