On Wed, 4 Oct 2006 at 5:09am, Meino Christian Cramer wrote:

> Hi,
>
>  when writing a function in vim script sometimes it makes sense to
>  change options of vim.
>
>  Are these changes local to the function ?
>  And if not: Can I simply assign the current value of the option to a
>  variable, change the option and restore the option value from the
>  value stored in that variable ?
>
>  Or is this way just another kind of "shooting into my own feet" ? :)
>
>  Keep hacking!
>  mcc

Yegappan already answered your question. However, in case you want to do
the whole of it in the same function, I recommend the below pattern:

let _ic = &ignorecase
set noic
try
    " do something
finally
  let &ignorecase = _ic
endtry

-- 
HTH,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to