November 30, 2010

Enable Emacs Copy and Paste

Whether you're looking for a new text editor, coming back to Emacs, or switching to Mac OS X and looking for something familiar, copy and pasting between Emacs and other applications can sometimes be problematic. In case you aren't aware Emacs is a command line cross-platform text editor. However, fans will quickly explain that it's quite a bit more than that since it can be extensively modified with a variety of add-ons.

The basic Emacs might seem a bit bland to someone used to MS Word and other graphical word processors. But in reality it does have some advantages. For one thing, compared to MS Word, or virtually any other word processor, Emacs flies, even on old hardware. It can edit many different formats, anything from plain text files to HTML files, programming files, etc.

The only barrier for new comers is a lack of playing nice with other applications when it comes to the clipboard. For instance, let's say you're browsing and want to save a link to your Emacs notebook, the default configuration will unfortunately not let you copy and paste from Firefox (or Safari, Chrome, etc.) to Emacs. Fortunately, there is a work around. On Mac, you just need to add some code to your .emacs file, which is the Emacs configuration file. On Linux, there's an add on, an .el file that provides support, along with a program called xclip. My next two posts will show you how to enable clipboard integration for Emacs on Mac OS X and Linux.

No comments:

Post a Comment