vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] How to insert text in a macro


From: Chris Green
Subject: Re: [vile] How to insert text in a macro
Date: Mon, 12 Oct 2015 11:34:00 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Oct 12, 2015 at 05:27:05AM -0400, Thomas Dickey wrote:
> On Sun, Oct 11, 2015 at 11:58:58AM +0100, Chris Green wrote:
> > I want to add some text to a file (just one line) in a stored
> > procedure and I just can't see how to do it.
> > 
> > If I do:-
> > 
> >     goto-beginning-of-file
> >     open-line-above-and-insert-chars
> > 
> > then I'm expected to type the line.  How do I actually get the text
> > inserted from the stored procedure?  Do I have to define a map!
> > command to do it and then execute it or is there a more elegant way? 
> 
> It's not elegant, but manipulating the $line value directly is the
> way I've done scripting.
> 
OK, thanks, I did the following in the end:-

        goto-beginning-of-file
        insert-string &env "pwd"
        insert-string "\n"

It's sometimes rather difficult to tell from the documentation what
something will do.  open-line-above-and-insert-chars switches
vile to insert mode whereas insert-string takes a string parameter to
insert.  Is there anywhere that would tell me this (apart from trying
them or finding examples which is how I found insert-string, there's
an example that uses it in the main help).


-- 
Chris Green



reply via email to

[Prev in Thread] Current Thread [Next in Thread]