Re: some vim standard ? (saving env)
- Hi Luc,
Here is my answer about the small set of function I suggested.
Luc Hermitte wrote:
>Of course, cursor() and search() solve common problems. But
> Sylvain Viart wrote:
> > Like Moving cursor functions,
> This function can be written as a very short line.
specific language function could be shared between plugins. Like
XML text motion:
finding tag (siblings, parent, current surrounding)
finding processing instruction
finding angle bracket <>
> > changing text functions,In fact, in this case I'm speaking about API, something like:
> I guess you are interrested in other functions that : |functions|
Replace(ms, me, string)
Which could replace the text marked by 2 named marks ms and me
with the variable string.
Would be nicer than...
:exe "norm `".ms."c`".me."\<c-r>=string\n\e"
...which is also one line of code ! ;)
> > saving and setting user param functions for register, mark, mapping,When I speak about saving user 'something' I mean that a script
> Could you be more specific ?
> For instance, I have two plugins (menu-map & misc_map) that help me to
> define complex mappings and menus.
should not change user environment if it could be avoided.
For example saving register is pretty simple:
Saving mapping is more difficult, but no more needed with <SID>
in much case. There's a script for that:
Saving marks, as I used in the snippet above, can be difficult
because of text movement on insert and delete.
For this specific case I'm currently working on another system
which gives the script a set of mark which can be scrapped.
So the script doesn't care about restoring mark because it wont alter
user habitual marks.
- Sylvain Viart -
- Blainville - Canada -
Je parle aussi le français.