[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] How to insert text in a macro
From: |
Thomas Dickey |
Subject: |
Re: [vile] How to insert text in a macro |
Date: |
Mon, 12 Oct 2015 06:51:06 -0400 (EDT) |
----- Original Message -----
| From: "Chris Green" <address@hidden>
| To: address@hidden
| Sent: Monday, October 12, 2015 6:34:00 AM
| Subject: Re: [vile] How to insert text in a macro
|
| 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
It might be nice if open-line-above-... would accept a sort of here-document.
(I seem to recall that being suggested a while back). There's no clean way
that I can see to have the text be on the same line.
| 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).
|
I usually start with :describe-bindings, and look for relevant words.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net