Re: Local scope ?

2006-10-12 Thread Benji Fisher
On Tue, Oct 03, 2006 at 10:00:51PM -0700, Hari Krishna Dara wrote: > > 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

Re: Local scope ?

2006-10-03 Thread Hari Krishna Dara
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, ch

Re: Local scope ?

2006-10-03 Thread Peter Hodge
Hello, > Hi, > > when writing a function in vim script sometimes it makes sense to > change options of vim. > > Are these changes local to the function ? No, they persist after the function is ended. As a simple example, you could use a function like the following to toggle the 'number' opt

Re: Local scope ?

2006-10-03 Thread Yegappan Lakshmanan
Hi, On 10/3/06, Meino Christian Cramer <[EMAIL PROTECTED]> 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 th

Local scope ?

2006-10-03 Thread Meino Christian Cramer
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