Use the Emacs Editor in Linux

Learn | Teach Open Source Technologies

Use the Emacs Editor in Linux

Emacs is one of the oldest and most versatile text editors available for Linux and UNIX-based systems. It’s been around for a long time (more than twenty years for GNU emacs) and is well known for its powerful and rich editing features. Emacs is also more than just a text editor; it can be customized and extended with different “modes”, enabling it to be used like an Integrated Development Environment (IDE) for programming languages like Java, C or Python.

For those who have used both the ubiquitous vi and the user-friendly nano, emacs would come as an interesting cross-between. Its strengths and features would resemble those of vi while its menus, help files and easy-to-remember command-keys would compare with nano.

In this article, we will see how we can install emacs in a Linux system and use it for basic text editing. Emacs is also available for graphical window managers for Linux like GNOME; however we will only cover the “text based” version here.

Install Emacs:

You can check if your Linux system has emacs installed by simply running the following command:

emacs

Red Hat / CentOS / Fedora:

yum install emacs

Ubuntu / Debian:

apt-get install emacs

In both cases, Linux will query the required package information from available mirrors or software libraries and ask whether you would like to go ahead and install it. It will also give you an estimate of disk space required. Once you say yes (with a single keystroke of “y”), all emacs packages and their dependencies will be downloaded and installed. The process is just like installing any other Linux package: a lot of text messages will scroll by and installation progress will be shown. At the end of it, emacs will be available for you to work with.

Emacs Commands:

1

1.1

Emacs Navigation:

2

2.1

Emacs – Deleting Text:

3

Emacs – Copying, Pasting, and Undo:

4

Emacs – Searching:

5

Emacs – Repeating Commands:

6

 

Comments are closed.