Sylvain Viart | 1 Dec 2002 04:45
Picon

Re: some vim standard ?

Hi,

I wrote:
> 
> Is there a standard vim library ?
>
I've found a partial answer to my question :

:he eval.txt

So much buildin function are already here !
It has been time I didn't check this part of the help.

cursor(l,c) will nicely replace my now old 

func! GotoLC(l,c)
	exe "norm ".a:l."G".a:c."|"
endf

And what about the searchpair() function, seems very powerful. Some
matching engine may be trashed...

I need to read :he version6.txt
5963 lines, pretty heavy.

Regards,
--

-- 
- Sylvain Viart -
  - Blainville - Canada -
Je parle aussi le français.
(Continue reading)

Luc Hermitte | 1 Dec 2002 04:18
Picon
Favicon

Re: some vim standard ?

* On Sat, Nov 30, 2002 at 08:59:56AM -0500, Sylvain Viart <viart.sylvain <at> videotron.ca> wrote:
> Is there a standard vim library ? For common function and macro ?  I
> often copy and paste function between script. It could be avoided.

No. There are many global functions developped by different people that
could serve as a library. That's all.

The best, IMHO, if you want to share functions between several scripts
of yours is to develop several modules independant of anything else.

If you found plugins/macros that already propose features you are
interrested in, my advice is to use these scripts. If you find bugs,
missing features, improper behaviour (because of a difference with your
environment) contact the author to see if he is willing to enhance his
script, if not then develop our own.

For an easier maintenance, cleanest code, etc, I prefer this modular
approach. I know that some people prefer redundancy and plugins made of
only one file. I rekon it is easier to install, but on the long run the
maintenance is thougher for the developper.

> Like Moving cursor functions, 

This function can be written as a very short line. 

> changing text functions, 

I guess you are interrested in other functions that : |functions|

> saving and setting user param functions for register, mark, mapping, 
(Continue reading)

Steve Hall | 1 Dec 2002 04:54
Picon

Includes


Is there any way to include a script within another script so that the
s: scope of the first is available to the second? I want to create
a library of variables external to the functions that use them, but
still not make them global.

Thanks.

Steve Hall  [ digitect(at)mindspring.com ]

Sylvain Viart | 1 Dec 2002 05:26
Picon

Re: some vim standard ? (stdlib.vim)

Hi Luc,

Thanks for you opinion.
I will split my answer. Here is the part about stdlib.vim. ;)

Luc Hermitte wrote:
> 
> Sylvain Viart wrote:
> > Is there a standard vim library ? For common function and macro ?  I
> > often copy and paste function between script. It could be avoided.
> 
> No. There are many global functions developped by different people 
> that could serve as a library. That's all.
>
[...]
> If you found plugins/macros that already propose features you are
> interrested in, my advice is to use these scripts.
[...]
> contact the author to see if he is willing to enhance his script,
> if not then develop our own.
> 
The well known big round wheel reinvented once again ! ;)

How do I found the interesting functions ?
Reading and reading undocumented vim code ?..
A pretty good challenge, isn't it. ;)

I've written this function, which gives me the <SID> of a loaded
script.

(Continue reading)

kbosau | 1 Dec 2002 06:05
Picon

Repeating of last command

Hello,

to repeat the execution of a formerly executed
normal mode command <...> n times I tried

...
norm <...>
exe 'norm '.n.' <at> :'
...

but this didn't work. Does anybody know why?

Thanks in advance

Klaus

Sylvain Viart | 1 Dec 2002 06:09
Picon

Re: some vim standard ? (saving env)

Hi Luc,

Here is my answer about the small set of function I suggested.

Luc Hermitte wrote:
> 
> Sylvain Viart  wrote:
> > Like Moving cursor functions,
> 
> This function can be written as a very short line.
>
Of course, cursor() and search() solve common problems. But
specific language function could be shared between plugins. Like
XML text motion:

finding tag (siblings, parent, current surrounding)
finding comment
finding processing instruction
finding angle bracket <>
...

> > changing text functions,
> 
> I guess you are interrested in other functions that : |functions|
>
In fact, in this case I'm speaking about API, something like:

Replace(ms, me, string)

Which could replace the text marked by 2 named marks ms and me
(Continue reading)

Sylvain Viart | 1 Dec 2002 06:19
Picon

Re: CTRL-Tab to switch buffers in MRU order

Hi Yanick,

Yanick Chenard wrote:
> 
> Would it be possible to make CTRL-Tab switch buffers
> as is customary in Windows e.i.:
>

:nmap <c-tab> :bu #<cr>

map ctrl+tab to switch between the current and the previous
buffer. Does it do what you want ?

Some reference that may help you in your quest :

:he nmap
:he :bu
:he <>
:he :ls
:he windows

A script which may do what you want:
http://vim.sourceforge.net/script.php?script_id=42

Hope that helps,
--

-- 
- Sylvain Viart -
  - Blainville - Canada -
Je parle aussi le français.

(Continue reading)

Joergen Haegg | 1 Dec 2002 08:25
Picon
Favicon

Re: problem using vim & perl 5.8.0

In message <845FCFF2D4C0FC468B485E8777C7A00C13F5A2 <at> cio-test001.spb.lucent.com> 
you write:
> 
> well, then it needs a closer look. But is perl-5.8.0 is first on your path
> when you really staring VIM?

Yes, it is:

wintermute{jh}201 perl -v

This is perl, v5.8.0 built for i386-linux-thread-multi

Copyright 1987-2002, Larry Wall

wintermute{jh}203 ldd /usr/bin/perl                         
        libdl.so.2 => /lib/libdl.so.2 (0x40022000)
        libm.so.6 => /lib/libm.so.6 (0x40026000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x40047000)
        libc.so.6 => /lib/libc.so.6 (0x40097000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x401aa000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Inside vim:

:!perl -v                                                     

This is perl, v5.8.0 built for i386-linux-thread-multi

Copyright 1987-2002, Larry Wall

(Continue reading)

Sylvain Viart | 1 Dec 2002 12:51
Picon

Re: Line change notification

Hi,

Todd Musall wrote:
> 
> I know Vim has b:changedtick to tell if a buffer is changed, but is
> there anyway to determine which lines within the buffer are changed?
>

May be `.  will help you.

:he `.

Regards,
--

-- 
- Sylvain Viart -
  - Blainville - Canada -
Je parle aussi le français.

Luc Hermitte | 1 Dec 2002 13:43
Picon
Favicon

Re: some vim standard ? (stdlib.vim)

Hello Sylvain,

* On Sat, Nov 30, 2002 at 11:26:54PM -0500, Sylvain Viart <viart.sylvain <at> videotron.ca> wrote:
> > No. There are many global functions developped by different people
> > that could serve as a library. That's all.
> >
> [...]
> > If you found plugins/macros that already propose features you are
> > interrested in, my advice is to use these scripts.
> [...]
> > contact the author to see if he is willing to enhance his script, if
> > not then develop our own.
> > 
> The well known big round wheel reinvented once again ! ;)

Exactly.

> How do I found the interesting functions ?
> Reading and reading undocumented vim code ?..
> A pretty good challenge, isn't it. ;)

Not necesserally. Some of us write plugins intended to be used by other
plugins. Often we also write a documentation.

> [maintenance & modularity]
> A common problem, in fact. May be a libbuilder would be a solution.

> Here is how I see the trick :
> 
> There is a library of plenty a functions for various task. A libbuilder
(Continue reading)


Gmane