On Mon, 10 Feb 2014 22:49:54 -0800 (PST)
Fidel N <[email protected]> wrote:
> I often find myself wrapping parts of scripts with "g.es" to check what it
> outputs, and soon ago I read Edward also does use g.es a lot, but its often
> anoying to go line by line wrapping it with g.es("Old Line Here")
> So ill do a wrapper/unwrapper.
The valuespace plugin has, in addition to all the complicated pieces
you can ignore ;-)
vs-eval
Execute the selected text, if any. Select next line of text.
Tries hard to capture the result from the last expression in the
selected text:
import datetime
today = datetime.date.today()
will captue the value of today even though the last line is a
statement, not an expression.
Stores results in c.vs['_last'] for insertion into body by vs-last or
vs-last-pretty. Removes common indentation (textwrap.dedent()) before
executing, allowing execution of indented code. g, c, and p are
available to executing code, assignments are made in the c.vs
namespace and persist for the life of c.
(missing from docs. - also outputs this result to log)
vs-last
Insert the last result from vs-eval. Inserted as a string, so
"1\n2\n3\n4" will cover four lines and insert no quotes, for repr()
style insertion use vs-last-pretty.
vs-last-pretty
Insert the last result from vs-eval. Formatted by pprint.pformat(),
so "1 2 3 4" will appear as '"1 2 3 4"', see all vs-last.
Cheers -Terry
> This will be a new command, I will suggest it also on git. IDK if default
> binding for this one would be too much...
>
> Can u guys think of something you often do while Leo'ing that could be also
> be accelerated with a small script?
> Do u like this one too or am i going too far? hehe.
>
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.