DEV Community

Cover image for Emacs
Haile Melaku
Haile Melaku

Posted on

Emacs

Okay guys as promised today am going to get into Emacs Editor and if you haven't seen my blog on vi(visual Editor) just Check it out.
Emacs or EMACS is a family of text editors that are characterized by their extensibility.
Emacs include some extra futures like:

  • Supporting many different human languages and programming/markup languages.

  • tools for compiling, running, and testing programs. Emacs integrates with GDB to provide an IDE.

  • compare two files and highlight their differences.

  • read news, mail, and RSS feeds.

  • You can even play tetris in Emacs

Fist before we start Emacs we need to learn this basic concepts

  • C -means Ctrl on your keyboard

  • M -means Alt on your keyboard(Esc key)


Starting Emacs

To enter emacs type

emacs
Here you will find all the instructions.
Image description

To open a file

emacs <file_name>

Image description

Image description
To close emacs and save

C-x C-c

Image description

To get out of the command
C-x C-g

To open a file
C-x C-f

To save the Changes

C-x C-s


Moving around

Some of the commands for movement in Emacs are:

C-f Forward one character
C-b Back one character
C-n Next line(Down)
C-p Previous line(up)

C-a Beginning of line
C-e End of line
M-f Forward one word
M-b Back one word
M-a Previous sentence
M-e Next sentence
M-v Previous screen
C-v Next screen
M-< Beginning of buffer
M-> End of buffer

Killing ("cutting") text

To cut a text in Emacs we use the command

C-k Kill line

Yanking ("pasting") text

To paste a text in Emacs we use the command

C-y Yanks last killed text
M-y Replace yanked text with previously killed text

Undo

To undo the changes in Emacs

C-/ Undo

Searching

To search in Emacs

C-s Incremental search

Tip: for more info see the Emacs official Documentation Emacs

Top comments (0)