Skip to content

Commit a296098

Browse files
committed
Initial commit
0 parents  commit a296098

File tree

4 files changed

+217
-0
lines changed

4 files changed

+217
-0
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.aux
2+
*.log
3+
*.pdf

Diff for: README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# emacs-cheatsheet
2+
3+
Mini guide to Emacs keyboard shortcuts.
4+
5+
### Building
6+
7+
1. Install dependencies:
8+
9+
sudo apt install git texlive
10+
11+
2. Grab the source:
12+
13+
git clone https://github.com/00-matt/emacs-cheatsheet.git
14+
15+
3. Build the PDF:
16+
17+
pdflatex emacs-cheatsheet.tex
18+
19+
### License
20+
21+
Released under the terms of the [Unlicense](https://unlicense.org).
22+
Do whatever you want.

Diff for: UNLICENSE.txt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org/>

Diff for: emacs-cheatsheet.tex

+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
\documentclass[12pt,a4paper]{article}
2+
3+
\usepackage[margin=1cm,landscape]{geometry}
4+
\usepackage{flowfram}
5+
\usepackage{lipsum}
6+
7+
\Ncolumn{3}
8+
\ffvadjustfalse
9+
\setlength{\columnsep}{1cm}
10+
\setlength{\parindent}{0cm}
11+
12+
\newcommand{\keyboardshortcut}[2]{#1 \hfill \texttt{#2}}
13+
14+
\begin{document}
15+
16+
\begin{center}{\Huge Emacs Cheatsheet}\end{center}
17+
18+
\section*{General}
19+
20+
\keyboardshortcut{Exit Emacs}{C-x C-c}
21+
22+
\keyboardshortcut{Open a file}{C-x C-f}
23+
24+
\keyboardshortcut{Kill a buffer}{C-x k}
25+
26+
\keyboardshortcut{Switch buffer}{C-x b}
27+
28+
29+
\section*{Movement}
30+
31+
\keyboardshortcut{Go to start of line}{C-a}
32+
33+
\keyboardshortcut{Go to end of line}{C-e}
34+
35+
\keyboardshortcut{Move forwards one character}{C-f}
36+
37+
\keyboardshortcut{Move backwards one character}{C-b}
38+
39+
\keyboardshortcut{Move forwards one word}{M-f}
40+
41+
\keyboardshortcut{Move backwards one word}{M-b}
42+
43+
\keyboardshortcut{Move up one line}{C-p}
44+
45+
\keyboardshortcut{Move down one line}{C-n}
46+
47+
\keyboardshortcut{Go to start of file}{M-<}
48+
49+
\keyboardshortcut{Go to end of file}{M->}
50+
51+
\keyboardshortcut{Go to line}{M-g g}
52+
53+
54+
\section*{Scrolling}
55+
56+
\keyboardshortcut{Scroll down one screenful}{C-v}
57+
58+
\keyboardshortcut{Scroll up one screenful}{M-v}
59+
60+
\keyboardshortcut{Adjust to current line}{C-l}
61+
62+
63+
\section*{Searching}
64+
65+
\keyboardshortcut{Search forwards}{C-s}
66+
67+
\keyboardshortcut{Search backwards}{C-r}
68+
69+
70+
\section*{Killing and Yanking}
71+
72+
\keyboardshortcut{\textbf{Delete} next character}{C-d}
73+
74+
\keyboardshortcut{Kill next word}{M-d}
75+
76+
\keyboardshortcut{Kill previous word}{M-DEL}
77+
78+
\keyboardshortcut{Kill to end of line}{C-k}
79+
80+
\keyboardshortcut{Kill to beginning of line}{M-0 C-k}
81+
82+
\keyboardshortcut{Kill selection}{C-w}
83+
84+
\keyboardshortcut{Yank previous kill}{C-y}
85+
86+
87+
\section*{Marking}
88+
89+
\keyboardshortcut{Start marking at cursor}{C-SPC}
90+
91+
\keyboardshortcut{Swap cursor and mark start}{C-x C-x}
92+
93+
\keyboardshortcut{Mark function}{C-M-h}
94+
95+
\keyboardshortcut{Mark buffer}{C-x h}
96+
97+
\keyboardshortcut{Mark next 5 words}{M-5 M-@}
98+
99+
\section*{Registers}
100+
101+
\keyboardshortcut{Save cursor position}{C-x r SPC}
102+
103+
\keyboardshortcut{Retrieve cursor position}{C-x r j}
104+
105+
\keyboardshortcut{Save selection}{C-x r s}
106+
107+
\keyboardshortcut{Insert from register}{C-x r i}
108+
109+
\section*{Macros}
110+
111+
\keyboardshortcut{Start recording a macro}{C-x (}
112+
113+
\keyboardshortcut{Stop recording a macro}{C-x )}
114+
115+
\keyboardshortcut{Replay last macro}{C-x e}
116+
117+
118+
\vfill\null
119+
\section*{Rectangles}
120+
121+
Create a rectangle by marking one corner and placing the cursor at the other.
122+
123+
\medskip
124+
\keyboardshortcut{Kill rectangle}{C-x r k}
125+
126+
\keyboardshortcut{Yank rectangle}{C-x r y}
127+
128+
\keyboardshortcut{Clear rectangle}{C-x r c}
129+
130+
\keyboardshortcut{Prefix rectangle}{C-x r t}
131+
132+
133+
\section*{Elisp}
134+
135+
\keyboardshortcut{Eval expression before cursor}{C-x C-e}
136+
137+
\keyboardshortcut{Evaluate buffer}{M-x eval-buffer}
138+
139+
\medskip
140+
\textbf{Example:} Adding a keybind to save and load cursor position
141+
from register.
142+
143+
\begin{verbatim}
144+
;;; ~/.emacs.d/init.el
145+
(global-set-key
146+
(kbd "C-c s")
147+
(lambda ()
148+
(interactive)
149+
(point-to-register 'a)))
150+
(global-set-key
151+
(kbd "C-c f")
152+
(lambda ()
153+
(interactive)
154+
(jump-to-register 'a)))
155+
\end{verbatim}
156+
157+
158+
\section*{Getting Help}
159+
160+
\keyboardshortcut{Open tutorial}{C-h t}
161+
162+
\keyboardshortcut{Show keybind}{C-h k}
163+
164+
\keyboardshortcut{Show Elisp function}{C-h f}
165+
166+
\keyboardshortcut{Show mode help}{C-h m}
167+
168+
\end{document}

0 commit comments

Comments
 (0)