Re: Script to surround text with ()

2006-07-11 Thread Vigil
One thing about this script is that it chucks the cursor to the end of the word. I wonder if there is a temporary mark we could use to save and restore the cursor position, or some other way that doesn't move it? -- .

Re: Script to surround text with ()

2006-07-11 Thread Benji Fisher
On Tue, Jul 11, 2006 at 09:24:03PM +0100, Vigil wrote: > One thing about this script is that it chucks the cursor to the end of the > word. I wonder if there is a temporary mark we could use to save and > restore the cursor position, or some other way that doesn't move it? Perhaps some of t

Script to surround text with (),.. what's wrong?

2006-07-10 Thread Marc Weber
This is my attempt to write script which can surround text (either a word or the text selected in visual mode) with some characters such as " ' ... But it doesn't work everytime. Do you see another solution than using @- (:h registers shows that this register is only used for text beeing less than

Re: Script to surround text with (),.. -- solved

2006-07-10 Thread Marc Weber
> >But it doesn't work everytime. This was my fault. exec @- did uses the deleted text before this deletion. > Why don't you use :imap and :vmap separately ? Seems to be a working idea. Now I've managed to get it working. The trick was to use only one normal command. = surround.vim w

Re: Script to surround text with (),.. what's wrong?

2006-07-10 Thread Yakov Lerner
On 7/10/06, Marc Weber <[EMAIL PROTECTED]> wrote: This is my attempt to write script which can surround text (either a word or the text selected in visual mode) with some characters such as " ' ... But it doesn't work everytime. Why don't you use :imap and :vmap separately ? You seem to be com

Re: Script to surround text with (),.. what's wrong?

2006-07-10 Thread hermitte
Marc Weber <[EMAIL PROTECTED]> wrote: > This is my attempt to write script which can surround text (either a > word or the text selected in visual mode) with some characters such as " > ' ... > > [...] > I want to use this to insert brackets, braces and also things like > try{ > ... > catch () {

Re: Script to surround text with (),.. what's wrong?

2006-07-10 Thread Marc Weber
> It is also available on SF, however I haven't updated it for a coupled of > years. > HTH, Do you still remember some keyword to find the functionality I'm looking for or the filename? I'm not sure where to start. Usage like this? runtimepath+=lh-cpp/ Thx Marc

Re: Script to surround text with (),.. what's wrong?

2006-07-10 Thread hermitte
Marc Weber <[EMAIL PROTECTED]> wrote: > > It is also available on SF, however I haven't updated it for a coupled of > years. > > HTH, > > Do you still remember some keyword to find the functionality I'm looking > for or the filename? Of course. :h Surround() This function permit to surround sel