- Day 1: Welcome to emacs
- Day 2: Help in Emacs
“ Emacs is the extensible, customisable, self-documenting real-time display editor.”
– Emacs Manual
Emacs can control OS subprocesses, helps in indenting programs, perform functions on many files at once and act as a simple text editor.
Emacs can be easily altered to behave in a certain way as you want and is highly customizable. Advanced users of emacs can go beyond simple customization and can create entirely new commands. These new commands are simple programs written in LISP and are also known as macros.
Most of my writing I do mainly with a Mac Pro, so I downloaded the mac version of emacs, there are multiple emacs variants present, but I preferred vanilla emacsformacosx, which gives me enough room for customization as per my needs.
The commands and helps mentioned in my blogs will work on all the emacs variants regardless of your choice of OS.
I downloaded MAC OS X from http://emacsformacosx.com/.
GNU Emacs development is hosted on savannah.gnu.org.
- Starting the editor: once installed start emacs from Launchpad -> emacs, clicking on which took me to the editor in its full glory, with a nice welcome message with a link to the manual and the beginner emacs tutorials to get a start working with emacs and to quickly get help in emacs “C-h (Hold down Ctrl and Press h)
We are following the standard emacs documentation while learning emacs to do our tasks, for the rest of the blog and my future emacs/non-emacs related posts, I am going to use Control Key as ‘C’. Alt or Esc Key as ‘M’ or referred in the document as meta key. Shift as ‘S’.
Control keys are the “CTRL” keys on your keyoboard, usually on the bottom-left and bottom-right(near the shift key) keys.
Meta Keys are “ALT” or “ESC” key on your keyboard.
Shift Keys are the “SHIFT” keys on the left(below caps lock key) and right (below enter key) on your keyboard.
|C-v||View next screen also as Page Up.|
|M-v||Move Backward one screen or Page Down.|
|C-l||redisplay the text with the cursor at the center of the screen.|
|C-p||Previous line or up arrow key.|
|C-b||back one character or left arrow key.|
|C-f||forward one character or right arrow key.|
|C-n||Next line or down arrow key.|
|M-f||Move one forward one word.|
|M-b||Move back one word.|
|C-a||Move to the beginning of the line.|
|C-e||Move to the end of the line.|
|M-a||Move to the beginning of the sentence.|
|M-e||Move to the end of the sentence.|
|C-u||to specify a repeat count. C-v and M-v are exceptions as they won’t move pages but instead will scroll to that many lines forward/backward|
|C-g||Kill the running command in minibuffer, or in case emacs stop responding.|
|C-d||Delete the next character after the cursor.|
|DEL||delete the character just before the cursor.|
|Insert||text insertion is as simple as typing it. you can use the C-u to insert text as well. for eg. C-u 10 – will insert 10 hyphens “-———”.|
||Kill the word before the cursor.|
|M-d||Kill the word after the cursor|
|C-k||Kill from the cursor position to the end of the line.|
|M-k||Kill to the end of the current sentence.|
|C-</td>||Set the mark, move around with the above keys to highlight the text.|
|C-y||Yank the file back.|
|C-x C-f||Find the file, can be used for creating a file or opening an existing file.|
|C-x C-s||Save the file, when you made some changes to the file and want to write the same to disk or save it.|
|C-x s||Save some buffers.|
|C-x C-b||List all the opened Buffers.|
|C-x b||Switch buffer around.|
|C-x C-c||Quit Emacs.|