usermod -s /usr/bin/emacs whynot

Posts tagged "emacs":

09 Jul 2019

Where to start learn emacs?

The best place to start is with Emacs itself :-)

To call emacs tutorial, open emacs and type:

C-h t

That is press "Ctrl" and "h" at the same time. Then press "t".

Read the whole tutorial. Take note of the most important key bindings. Play with the commands for few days. I guarantee you will love Emacs and start using it :-)

If you want to read the tutorial again but you don't want to read the whole explation, here is a list of commands and what they do.

BASIC CURSOR CONTROL


C-f Move forward a character
C-b Move backward a character

M-f Move forward a word
M-b Move backward a word

C-n Move to next line
C-p Move to previous line

C-a Move to beginning of line
C-e Move to end of line

M-a Move back to beginning of sentence
M-e Move forward to end of sentence

C-l Clear screen and redisplay all the text, moving the text around the cursor to the center of the screen. C-l C-l or C-u 0 C-l Clear screen and bring this line to the top of screen

M-< or ESC-< Moves to the beginning of the whole text
M-> or ESC-> Moves to the end of the whole text.the of the whole text

C-u 8 C-f or M-8 C-f Moves forward eight characters

C-u 8 C-v Moves forward eight characters

IF EMACS STOPS RESPONDING


C-g Stop a command which is taking too long to execute.
C-g Discard a numeric argument or the beginning of a command that you do not want to finish.

disabled commands


Some Emacs commands are "disabled" so that beginning users cannot use them by accident.

If you type C-x C-l, you get:

emacs-disabled-comments.png

WINDOWS


C-x 1 One window (i.e., kill all other windows).

INSERTING AND DELETING


<DEL> Delete the character just before the cursor
C-d Delete the next character after the cursor

M-<DEL> Kill the word immediately before the cursor
M-d Kill the next word after the cursor

C-k Kill from the cursor position to end of line
M-k Kill to the end of the current sentence

C-y Yank the last killed text
M-y Replaces that yanked text with the previous kill. Typing M-y again and again brings in earlier and earlier kills
C-u 2 M-y Replaces that yanked text with the second previous kill.

C-u 8 * insert 8 *

C-u 2 C-k kills two lines and their Newlines

UNDO


C-/ or C-_ Undo the change.

FILES


C-x C-f Find a file
C-x C-s Save the file

BUFFERS


C-x C-b List buffers
C-x b Switch buffers
C-x s Save some buffers

EXTENDING THE COMMAND SET


C-x Character eXtend. Followed by one character.
M-x Named command eXtend. Followed by a long name.

Examples C-x C-f Find file
C-x C-s Save file
C-x s Save some buffers
C-x C-b List buffers
C-x b Switch buffer
C-x C-c Quit Emacs
C-x 1 Delete all but one window
C-x u Undo

C-z Exit Emacs temporarily.
C-z On terminal, suspens Emacs. Use "fg" or "%emacs" to resume

AUTO SAVE


M-x recover-this-file <Return> Recover the visited file. Get contents from its last auto-save file.

MODE LINE


M-x text-mode <Return> Toggles the text mode
M-x auto-fill-mode <Return> Toggles the auto fill mode
C-x f Change the margin for the auto fill mode. Default is 70 characters
C-u 20 C-x f Set the margin for the auto fill mode to 20 using a argument
M-q Re-fill a paragraph if the auto fill mode was changed in the middle of a paragraph

SEARCHING


C-s Forward search
C-r Reverse search

MULTIPLE WINDOWS


C-x 2 Splits the screen into two windows. Display the same file in both windows
C-x 4 C-f Open a second window to display an other file
C-M-v Scroll other window
C-x o Select other window
C-v Scroll up
M-v Scroll down

MULTIPLE FRAMES


C-x 5 2 Create a new frame
C-x 5 0 Remove the selected frame

RECURSIVE EDITING LEVELS


M-x then type <ESC> <ESC> <ESC> Get out the recursive editing level

GETTING MORE HELP


C-h The help character
C-h ? Emacs will tell you what kinds of help it can give
C-h c Describe key briefly
C-h c C-p Emacs displays a very brief description of C-p
C-h k C-p To get more information about a command, use C-h k instead of C-h c
C-h f Describe a function
C-h v Describe a variable
C-h a Command Apropos. Type in a keyword and Emacs will list all the commands whose names contain that keyword.
C-h a file <Return> Displays a list of all M-x commands with "file" in their names.
C-h i Info buffer. You can read included manuals
C-h i m emacs <Return> Info buffer. Read the Emacs manual

MORE FEATURES


C-h r Display the Emacs manual in Info mode

CONCLUSION


C-x C-c Exit Emacs

COPYING


This tutorial descends from a long line of Emacs tutorials starting with the one written by Stuart Cracraft for the original Emacs.

This version of the tutorial is a part of GNU Emacs. It is copyrighted and comes with permission to distribute copies on certain conditions:

Copyright (C) 1985, 1996, 1998, 2001-2019 Free Software Foundation, Inc.

This file is part of GNU Emacs.

GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see https://www.gnu.org/licenses/.

Please read the file COPYING and then do give copies of GNU Emacs to your friends. Help stamp out software obstructionism ("ownership") by using, writing, and sharing free software!

Tags: emacs
09 Jul 2019

Why emacs?

Because Emacs:

Emacs started as a text editor, then it became a way of life.

Richard Stallman

The idea that you could do every task without leaving Emacs is amazing. Is Emacs an operating system? I don't know.

Today I enjoy Emacs as a text editor. Tomorrow I would like to extend this to:

Tags: emacs
Other posts