vile
[Top][All Lists]
Advanced

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

Re: [vile] Need some help with the -c command line option - how to get i


From: Thomas Dickey
Subject: Re: [vile] Need some help with the -c command line option - how to get into insert mode?
Date: Sun, 24 Jun 2012 07:05:14 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jun 24, 2012 at 11:22:15AM +0100, Chris Green wrote:
> I want, if possible, to fire up vile from the command line so that it
> automatically goes to end-of-file in insert mode so one can just start
> typing. 
> 
> It's easy enough to get to the end of the file:-
> 
>     vile -cgoto-end-of-file <filename>
> 
> but how do I do '$a'?  (I.e. go to end of line, append)

I don't recall that you can:

+ First, the commands passed using -c are somewhat more restricted than the
  scripting features (but use them directly by building a script), and
+ second because the scripting features assume that each line of the script
  begins a new command (except of course when handling continuation lines).

Insertions have always been an awkward area in the scripting, worked around
by setting state variables or making special cases where the text is passed
as a parameter on the same line as the command.

A while back I considered adding something like a here-document feature
to the scripting, so that I could implement something like

append-lines-til-tag Tag
some text
more text
Tag

(didn't yet...).  That would still fit into the new-command-per-line
model.  Likewise, a mail-like interface would be straightforward:

append-lines-til-dot
some text
more text
.

Both are line-oriented.  But exiting a script with the buffer in
insert-mode would be something different.  Thinking about it, it
would perhaps be doable to make a special case and leave some
single buffer in insert-mode.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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