HomeAbout MePortfolioContact
Other
A very simple guide to GNU Emacs
Viet Anh Ng.
September 06, 2016
1 min

This guide was written in Emacs editor.

Introduction to GNU Emacs

GNU Emacs is a text editor in GNU project.

Why should we use Emacs for code editing?

  • High perfomancce
  • Many awesome features for programming:
    • Jump to any header file.
    • Autocompletion.
    • Showing function arguments.
    • Quickly comment.
    • And many more features depending on your configuration.

Installation

This guide uses GNU Emacs running on Ubuntu 16.04.

To Install Emacs, you can simply open Terminal and type:

If you’re using another operating system, just Google and you can easily find the installation guide for your OS.

Using Emacs

To start Emacs, open Terminal and type emacs& to open Emacs GUI or emacs -nw to open Emacs Terminal.

Basic shortcuts in Emacs

Firstly, in Emacs shortcuts, ‘C’ will stand for Ctrl key and ‘M’ will stand for Meta key (Esc key or Alt key on your keyboard).

1.File:

ShortcutDescription
C-x C-fOpen file
C-x C-sSave
C-x C-wSave as
C-x sSave all
C-x C-vRevert to file
M-xRevert Buffer
C-x kClose Windows/Buffer
C-x C-cQuit

2.Edit:

ShortcutDescription
C-_Undo
C-SpaceBegin Selection
C-gCancel Seclection
C-wCut Seclection
C-kCut Line (From current position to the end of the line)
C-yPaste
C-x r s <number>Copy Selection to Numbered Clipboard
C-x r i <number>Paste from Numbered Clipboard
Delete or C-dDelete
M-DeleteDelete Word Before The Cursor
M-dFwd Delete Word

3.Cursor Movement:

ShortcutDescription
M-fWord Forward
M-bWord Backward
C-a / C-eJump to beginning / end of line
M-{ / M-}Paragraph Forward / Backward
C-v / M-vPage Forward / Backward
M-< / M->Jump to beginning / end of file
M-C-a / M-C-eC Function Forward / Backward

Above is a very basic guide to GNU Emacs. You can find more documents about Emacs at : GNU Emacs - GNU Projects.


Tags

Viet Anh Ng.

AI Developer / Blogger

Hi! I'm a software engineer. I love AI technologies and currently, I'm using machine learning to build awesome software products.

Expertise

AI
Deep Learning
Computer Vision

Social Media

githubtwitterwebsite

Related Posts

Gọi hàm Python trên C++ với OpenCV
March 31, 2020
2 min
© 2020, All Rights Reserved.

Quick Links

About mePortfolioContact

Social Media