3 ms·
> you can just press v to open up vi with a temp file containing that command, edit it using the full-screen view and power of vi, then save the file and it run
by oskarth 10y ago
> you can just press v to open up vi with a temp file containing that command, edit it using the full-screen view and power of vi, then save the file and it runs automatically.
FWIW you can do this with ctrl-x ctrl-e in normal (emacs-like mode) and it will open up your $EDITOR. Example:
> EDITOR=nano # or EDITOR=vi, EDITOR=emacs, etc
> echo [ctrl-x ctrl-e]
* edit command by adding foo and save*
> echo foo
- allannienhuis 10y agoawesome tip! thanks!
- vram22 10y agoThanks, good to know. I don't use emacs, but thinking of trying it out after these years of not using it. In the initial years I did not have access to it on the Unix machines I worked on, only had vi, and later I read that it needed a lot more keystrokes than vi, also the high use of Ctrl key, which is in an awkward position (though I know it can be swapped with say Caps Lock through software). That may be why I did not get into using it, though I have read that it is extremely powerful because it is programmable in Elisp. (I've read Steven Levy's book and some other stuff about GNU, rms, etc., including the book Free as in Freedom about him and GNU. Good read.) I love programmable tools and prefer them to the non-programmable kind, but have kind of made an exception of sorts in the case of editors - I know vim too is programmable but having looked briefly at its syntax, don't like it much. So I guess I may get into emacs after all, but somewhat slowly.