Linux Blog

Daily vim, Easier Command Line Editing Hack

Filed under: Quick Linux Tutorials — at 2:06 pm on Tuesday, July 7, 2009

I’m a fan of the Daily Vim. While reading, I came across the old long command line edit:

Since I don’t have emacs installed (fire away) after Pressing CTRL-x CTRL-e to edit the command, this is what I got:

[owen@LinuxBlog ~]$
bash: /usr/bin/emacs: No such file or directory

There is a simple fix for this:

sudo ln -s vim /usr/bin/emacs

I’m sure there is a correct way to do this, but this is what I did and it has worked well for me so far.


Comment by shaktale

July 7, 2009 @ 3:23 pm


$> echo “export EDITOR=vim” >> $HOME/.bashrc

Works for me.


Comment by

July 7, 2009 @ 3:34 pm

Ahh, I did search my environment variables for anything with emacs in them, but my EDITOR variable wasn’t set. Thats a good alternative, if you don’t have root access or don’t want to make the change globally.

Comment by anon

June 5, 2011 @ 6:19 pm

What a completely insane thing to do. Also, if vim isn’t in the current directory, that command wouldn’t even work.

By the way, the global alternative would be echo "export EDITOR=vim" >> /etc/profile

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>