views:

172

answers:

2

Today's Daily Vim says this:

Assuming you're using the bash shell, the following can be helpful when composing long command lines.

Start typing on the command line and then type Ctrl-x Ctrl-e, it should drop you into your system's default editor (hopefully Vim) and allow you to edit the command line from there. Once finished, save the command line, and bash will run the command.

Is there any way to do this in tcsh?

+1  A: 

Hmmm... IIRC, tcsh uses a command called bindkey. Try bindkey -v at the command line. Then hit escape followed by v. It's been a while since I used tcsh so the details are a bit fuzzy. When in doubt, Google it.

D.Shawley
that's not a very useful answer. I know that I can use various bindings to edit the commandline. The question is if I can somehow copy the commandline to $EDITOR, edit it and then copy it back, all automatically like Bash apparently does.
Nathan Fellman
@Nathan - a good start is to man tcsh and take a look at the section about bindkey. In particular, look at `run-fg-editor` I believe that this is what you are after. It's been about 15 years since I used tcsh so my memory is a little fuzzy.
D.Shawley
+2  A: 

A little explanation for the uninitiated.

bindkey -v

puts you in vi-mode (oh yeah!)

and hitting v from there would take you to $EDITOR -- and all is good with the world from there on.

jeffjose