EMACS TEXT EDITOR BASIC COMMANDS



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 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

emacs EDITOR:
emacs

emacs  file.txt

1.  emacs Navigation:

  • ctrl+n  -  Next line 
  • ctrl+p  -  Previous line 
  • ctrl+f  -  Move cursor forward one character 
  • ctrl+b  -  Move cursor backward one character 
  • alt+f  -  Forward one word 
  • alt+b  -  Backward one word 
  • ctrl+a  -  Move to beginning of line 
  • ctrl+e  -  Move to end of line 
  • alt+a  -  Move to beginning of sentence 
  • alt+e  -  Move back to end of sentence 
  • alt+<  -  Goto the beginning of the file 
  • alt+>  -  Goto the end of the file

2.  emacs Searching:

  • ctrl+s  -  Start forward search 
  • ctrl+r  -  Start a reverse search 
3.  emacs Repeating command:
  • ctrl+u {num} {command}  -  Repeat {command} {num} times

4. emacs Find and Replace:

  • alt+% {old} {new}!  -  Subtitute {new} for {old} in the entire file 
5.  emacs Deleting Text:
  • ctrl+d  - Delete a character 
  • alt+d  -   Delete a word

6.  emacs  copy/paste:

  • ctrl+k  -  Kill (cut) the rest of the current line to text 
  • ctrl+y  -  Paste from the previously killed text 
7.  emacs Undo:
  • ctrl+x  u  -  Undo

8.  emacs Save and Quit:

  • ctrl+x  ctrl+s   -  Save the file 
  • ctrl+x  ctrl+c  -  Exit 
9.  emacs Help:
  • ctrl+h  -  Help 
  • ctrl+h  t  -  Tutorial 
  • ctrl+h  k {key}  -  Describe {key}
To change the major mode from within emacs, press the alt+x keys. The mini buffer will wait for your response. Examples of some major modes are: 
  •   c-mode
  • python-mode
  • java-mode
  • html-mode
  • perl-mode
  • shell-script-mode
  • text-mode and press Enter.

To give an idea of the power of emacs, here are some extras available from its Tools menu:
  • Calendar 
  • Simple calculator 
  • Programmable calculator 
  • Searching a directory 
  • Encrypting and decrypting document 
  • Send and read e-mails 
  • Search files using grep 
  • Spell checking 
  • Running shell commands and compiling codes 
  • Version control 
  • Compare and merge files

EMACS TEXT EDITOR BASIC COMMANDS EMACS TEXT EDITOR BASIC COMMANDS Reviewed by vijay pratap singh on April 02, 2017 Rating: 5

No comments:

Powered by Blogger.