On 2/14/08, Milan Vancura <[EMAIL PROTECTED]> wrote:

> 1. there is no way to clear all signs in one file - strange


I'll get to this in a second...

2. there are no internal functions to work with signs - get a list of them
> etc.
>
>   for example as far as I understand it, ':sign list' is completely
> unusable in
> scripts
>
> Not exactly;
:redir => s:signs
:silent sign place
:redir END

Now the output of the ':sign place' command is redirected into the variable
s:signs, which you can parse through with the built-in regex functions.
It is perhaps not as clean as it would be with internal functions, but
certainly do-able.
After setting up the redirection, you'll want to execute the command with
:silent, so that the output isn't also copied to the screen, forcing the
user
to tap through several "Press ENTER" prompts.

Knowing this, you may now programatically remove all signs found in a single
file.

3. mksession does not stores signs (probably the result of point 2)


This is unfortunate.
Although, if you see a need for such functionality, you could write a plugin
that wraps the :mksession
command, and uses the redirection mentioned above to add code to the session
file which would replace
all signs upon loading of the session.

4. minor one: re-definition of some sign has no immediate effect, one must
> redraw screen
>

This is the case with many operations that change things on the display; it
is common in Vim scripts to finish a function with a :redraw
to make sure everything is ready for the user to see.  This way, you can
efficiently do many screen-updating commands and delay
expensive redraws until the end.

Read all about it:
:help lazyredraw

Hope this helps
-- 
Erik Falor
Registered Linux User #445632 http://counter.li.org

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui