Emacs

by Daniel Pimentel — Tue 04 April 2000

GNU Emacs was originally implemented in 1976 on the MIT AI Lab's Incompatible Timesharing System (ITS), as a collection of TECO macros. The name “Emacs” was originally chosen as an abbreviation of 'Editor MACroS'. This version of Emacs, GNU Emacs, was originally written in 1984.

Shell

M-x shell
M-x eshell

Compile

M-x compile

Debug

M-x gdb

Grep

M-x grep

Man

M-x man

Diff

M-x ediff

FIle manager

M-x dired

Read news, mail and feeds

M-x gnus

Games

M-x doctor
M-x tetris
M-x snake
M-x 5x5
M-x blackbox
M-x decipher
M-x dissociated-press
M-x dunnet
M-x hanoi
M-x landmark
M-x life
M-x morse-region
M-x mpuz
M-x pong
M-x snake
M-x solitaire
M-x studlify-region
M-x zone

IRC

M-x irc

Invoking shell commands

M-x shell-command or M-!

Tools

M-x calculator
M-x calendar
M-x phases-of-moon

Version control

M-x vc-next-action or C-x v v

Help

C-h t
C-h r
C-h C-f

Moving in buffers

KeyMeaning
C-fForward one character
C-nNext line
C-bBack one character
C-pPrevious line
C-aBeginning of line
M-fForward one word
M-aPrevious sentence
M-vPrevious screen
M-<Beginning of buffer
C-eEnd of line
M-bBack one word
M-eNext sentence
C-vNext screen
M->End of buffer
C-u 3 C-pBack 3 lines
C-u 10 C-fForward 10 characters
M-1 M-0 C-fForward 10 characters
C-u C-nForward 4 lines
C-u C-u C-nForward 16 lines
C-u C-u C-u C-nForward 64 lines
M-g gJump to specified line
C-sIncremental search forward
C-rIncremental search backward

Mark

KeyMeaning
C-SPCSet mark to the current location
C-x C-xSwap point and mark
C-u C-SPCCycle through mark ring

Region

KeyMeaning
C-x hMake region contain the entire buffer ('Select all')
M-hMake region contain the current paragraph
C-x n nNarrow buffer to the current region
C-x n wRestore ('widen') buffer

Killing ('cutting') text

KeyMeaning
C-kKill line
C-u 10 C-kKill 10 lines
C-wKill region ('cut')
M-wSave region to kill ring without deleting ('copy')
M-dKill next word
M-kKill to end of sentence

Yanking ('pasting') text

KeyMeaning
C-yYanks last killed text
M-yReplace yanked text with previously killed text

Undo

KeyMeaning
C-/Undo
C-_Undo
C-x uUndo

Incremental search

KeyMeaning
C-sIncremental search
C-s C-sSearch for most recently searched item
C-s M-pPrevious item in search history
C-s M-nNext item in search history
C-h k C-sGuide to more commands available in incremental search
C-rBackward incremental search

Search and replacement

KeyMeaning
M-%Query replace

Regular expression search

KeyMeaning
C-M-sRegular expression incremental search

Keyboard Macros

KeyMeaning
F3Start recording macro
F4Stop recording macro
F4Play back macro once
M-5 F4Play back macro 5 times
M-0 F4Play back macro over and over until it fails

emacs ~/.emacs

;;; 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.
;;;
;;; 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 Emacs.  If not, see <http://www.gnu.org/licenses/>.
;;;
;;; Emacs --- Emacs config
;;; Copyright ©2000-2017 Daniel Pimentel <d4n1@d4n1.org>
;;;
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with Emacs.  If not, see <http://www.gnu.org/licenses/>.

;; Emacs custom
(package-initialize)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(tool-bar-mode nil)
 '(menu-bar-mode nil)
 '(custom-enabled-themes (quote (wombat)))
 '(inhibit-startup-screen t)
 '(initial-scratch-message ';; GNU Emacs')
 '(tooltip-mode nil)
 '(scroll-bar-mode nil)
 '(column-number-mode t)
 '(font-use-system-font t))

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(cursor ((t (:background 'red')))))
(put 'scroll-left 'disabled nil)

;; Exwm custom
(require 'exwm)
(require 'exwm-config)
(require 'exwm-cm)
(exwm-config-default)
(setq window-system-default-frame-alist '((x . ((alpha . 100)))))
(setq exwm-cm-opacity 83)
(exwm-cm-enable)

;; Pdf-tools
(pdf-tools-install)
GNU Emacs
2000-2016 by Daniel Pimentel under GFDL