sneaky invoke-editor trick

Share your own howto's etc. Not for support questions!

sneaky invoke-editor trick

Postby Grifter » 2006-06-08 17:33

playing around on the keyboard I just learned that hitting ^X^E invokes the editor (which is specified in /etc/alternatives) with the text you have typed in the current commandline in the editor and wanted to share this marvelous discovery :D
Eagles may soar, but weasels don't get sucked into jet engines...
Grifter
 
Posts: 1572
Joined: 2006-05-04 07:53
Location: Svea Rike

Postby Grifter » 2006-06-09 12:10

the best way to choose which editor should be the default to use, is this (as root):
update-alternatives --config editor
it will then ask you which to use
Eagles may soar, but weasels don't get sucked into jet engines...
Grifter
 
Posts: 1572
Joined: 2006-05-04 07:53
Location: Svea Rike

Postby Lou » 2006-06-09 18:32

Hmm, it doesn't kick in, probably because my kb is a spanish Logitech. I launch my terminal in ion3 with Ctrl+F1 .
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Postby ajdlinux » 2006-06-09 22:52

It works for me.
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby ajdlinux » 2006-06-09 22:54

Also when you save it that becomes the command that is executed, e.g.:

$ ls^X^E
== editor ==
ls -la
^X (exit)
ls -la

total 1644
drwxr-xr-x 13 andrew andrew 4096 2006-06-09 21:11 .
drwxr-xr-x 38 andrew andrew 4096 2006-06-10 08:47 ..
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby lacek » 2006-06-14 11:40

If it doesn't work for you (as it didn't for me at the first time), try setting the EDITOR environmental variable like this:
Code: Select all
export EDITOR=/usr/bin/vim

After this, the specified editor will be spawned upon pressing ^X^E.
lacek
Moderator Team Member
 
Posts: 769
Joined: 2004-03-11 18:49
Location: Budapest, Hungary


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable