[BusyBox] vi applet for busybox
Erik Andersen
andersen at lineo.com
Wed Apr 4 18:24:22 UTC 2001
On Mon Apr 02, 2001 at 01:01:27AM -0700, Sterling Huxley wrote:
> This patch contains a vi-like editor applet for busybox. It can also
> be used standalone. With all features turned on the vi.o binary is 37K
> with text size of 22K. With minimal features the .o is 22K and text is 12K.
>
> Some of the features are:
> Pattern searches with / and ?, but, no magic with * and .
> Last command repeat with '.'
> Line marking with 'x
> Named buffers with "x for yank and put
> Readonly with -R command line arg
> Some colon mode commands with ':'
> Settable options with ":set"
> (autoindent, ignorecase, showmatch, tabstop=#)
> Signal catching- ^C
> Job suspend and resume with ^Z
> Adapt to window re-sizes
>
> The file is held completely in memory. This could be good if you don't have
> a disk drive, or bad if the file is too big for memory.
Wow! I've now had a chance to give it a good workout, and it looks very good.
And although I said "no new features till after the 0.51 release" -- I lied. I
just checked in your work. :-) Thanks!
I did find a few problems:
*) Hit ":" then hit Esc and you are not returned out of ex mode. You have to
hit enter to get out.
*) The "u" undo command does not undo the result of "P" or "p"
*) Hit "dd" then hit "u" and it will restore the deleted line over the
top of the current line, rather then re-inserting a line.
*) ":e /etc/profile" does not work, but ":e cat.c" does (i.e. ":e" only
works for files in the current directory. Same applies to ":r")
*) "cc" deletes the current line like a "dd" instead of clearing it and
letting you rewrite it in place.
*) "d^", "y^" etc do not work, though "d$" and "y$" do.
Some wishlist items.
*) I often use G to go the EOF, so that is missed
*) It would be nice if hitting "Insert" twice would invoke "R" as in vim
*) Having ":! <foo>" and ":r !<cmd>" work would be nice
*) M would be nice (since you have H and L)
*) ^R would be nice (since you have ^L anyways)
*) It might be nice to call show_status_line() after each movement (arrows, hjkl)
or searching routine. This is not traditional vi behavior though....
*) % would be nice (can use the sed code here -- possible moving part to libbb?)
*) Now the big one -- it would be very cool if your could hook into cmdedit.c and
use that for ex mode. I havn't thought through all the issues involved, but
the result would be very cool.
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list