From: steve on
How, in 'vi', do I make an interactive macro?

I'm going along in insert mode and at some point I want to pull up a
form and fill it in, say,

Name: <enter something>
Rank: <enter something>
Serial Number: <enter something>

and back to the normal insert mode. I've tried simply having the form
as a separate script and invocing it with '!' but it will not pause
for input.
From: steve on
On Apr 18, 3:22 pm, Michael Vilain <vil...(a)NOspamcop.net> wrote:
> In article
> <e634dd22-904c-453c-a94d-06f3d9e23...(a)j21g2000yqh.googlegroups.com>,
>
> steve <shmarto...(a)ticnet.com> wrote:
> > How, in 'vi', do I make an interactive macro?
>
> > I'm going along in insert mode and at some point I want to pull up a
> > form and fill it in, say,
>
> > Name: <enter something>
> > Rank: <enter something>
> > Serial Number: <enter something>
>
> > and back to the normal insert mode. I've tried simply having the form
> > as a separate script and invocing it with '!' but it will not pause
> > for input.
>
> You can't. vi is for editing files.

Uh... that's what I'm trying to do. Let me rephrase the question. I
want a macro that prints out "Name:", waits for me to enter a value,
then prints out "Rank:", waits for me to enter a value, etc. The key
part is that I want a macro that will wait for input before it
continues. Something the WordPerfect 5.1 in DOS handled without
difficulty.

--
From: Janis Papanagnou on
steve wrote:
> On Apr 18, 3:22 pm, Michael Vilain <vil...(a)NOspamcop.net> wrote:
>> In article
>> <e634dd22-904c-453c-a94d-06f3d9e23...(a)j21g2000yqh.googlegroups.com>,
>>
>> steve <shmarto...(a)ticnet.com> wrote:
>>> How, in 'vi', do I make an interactive macro?
>>> I'm going along in insert mode and at some point I want to pull up a
>>> form and fill it in, say,
>>> Name: <enter something>
>>> Rank: <enter something>
>>> Serial Number: <enter something>
>>> and back to the normal insert mode. I've tried simply having the form
>>> as a separate script and invocing it with '!' but it will not pause
>>> for input.
>> You can't. vi is for editing files.
>
> Uh... that's what I'm trying to do. Let me rephrase the question. I
> want a macro that prints out "Name:", waits for me to enter a value,
> then prints out "Rank:", waits for me to enter a value, etc. The key
> part is that I want a macro that will wait for input before it
> continues. Something the WordPerfect 5.1 in DOS handled without
> difficulty.

And what has this 5.1 thing, or your original question, to do with a
Unix shell? You're probably looking for the newsgroup comp.editors.

>
> --
From: Bill Marcum on
On 2010-04-18, steve <shmartonak(a)ticnet.com> wrote:
>
> Uh... that's what I'm trying to do. Let me rephrase the question. I
> want a macro that prints out "Name:", waits for me to enter a value,
> then prints out "Rank:", waits for me to enter a value, etc. The key
> part is that I want a macro that will wait for input before it
> continues. Something the WordPerfect 5.1 in DOS handled without
> difficulty.
>
And emacs could probably do so as well, or a shell script could do it and
then start vi.


--
The culpability of a female or oneself is a matter of opinion, however.
-- ¬R
From: Seebs on
On 2010-04-18, steve <shmartonak(a)ticnet.com> wrote:
> Uh... that's what I'm trying to do. Let me rephrase the question. I
> want a macro that prints out "Name:", waits for me to enter a value,
> then prints out "Rank:", waits for me to enter a value, etc. The key
> part is that I want a macro that will wait for input before it
> continues. Something the WordPerfect 5.1 in DOS handled without
> difficulty.

vi is not that kind of an editor; it's a much lower-level one.

You can actually probably do this with plugins; I assume vim has plugin
architecture, and I know nvi does, so you can write programs in various
scripting languages. Still, this really doesn't seem at all like the
right tool for the job.

WordPerfect had to do all sorts of crazy stuff that was not editing
files because it couldn't be running at the same time as any other program.
Unix doesn't have that problem. If you want to fill stuff in in files
based on form input, honestly, my first choice would be a web app.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!