Sunday, November 25, 2012

Running Vim inside Emacs

A member of this group wants to run Vim on a Window, and SBCL on another Window. He already tried ConqueTerm, Gnu Screen and Konsole, but all these solutions have serious drawbacks. I was in the same situation a few months ago. I needed to run SBCL on a window, while editing source code on another window. At some point, I remembered the joke about Emacs being an excellent operating system, but lacking a good editor. Therefore, I decided to provide a good text editor to that excellent operating system.

The scheme is quite simple. Use Slime to call SBCL as inferior lisp. To make things easier, ask Emacs to open a nonexistent Lisp file:

~$ emacs garbage.lisp &

Emacs will open a blank file, with Slime and all the rest of Lisp magics. Choose the option 'Lisp/Run inferior Lisp'. This action will launch SBCL. Split the SBCL window with C-x 2. On the split window, type the command

M-x term

Emacs will open a terminal on one of the two split windows. You can start Vim up on this terminal. When Emacs asks which program you want to run, write Vim.

/usr/local/bin/vim

Be carefull. You must open a term buffer. The trick does not work on shell buffers. Of course, you can use all Emacs goodies: Org mode for managing projects, flymake for checking the syntax, dired and ido for fast access file, etc. I have been running Vim from inside Emacs for three months. I wonder whether this approach has drawbacks. It must have, because nobody uses it, as far as I know. Can anybody tell me why it is not widely used?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: