Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

349 lines
10 KiB

  1. \documentclass[10pt]{article}
  2. \usepackage[margin=0.5cm,landscape,a3paper]{geometry}
  3. \pagestyle{empty}
  4. \usepackage{textcomp}
  5. \usepackage{multicol}
  6. \usepackage{menukeys}
  7. \usepackage{enumitem}
  8. \usepackage{xcolor}
  9. \usepackage{xpatch}
  10. \usepackage{xparse}
  11. \usepackage{calc}
  12. \usepackage{tcolorbox}
  13. \definecolor{default}{HTML}{333333}
  14. \definecolor{heading}{HTML}{000000}
  15. \definecolor{command}{HTML}{666666}
  16. \definecolor{key}{HTML}{268BD2}
  17. \renewcommand\section[1]{\bigskip\par\textbf{\color{heading}\large#1}\smallskip}
  18. \renewcommand\subsection[1]{\smallskip\par\textbf{\color{heading}#1}}
  19. \newcommand\humanreadable[1]{{\par\color{default}\small\sffamily#1}}
  20. \newcommand\meta[1]{\textlangle\textit{#1}\textrangle}
  21. \newcommand\keyify[1]{\color{key}\ttfamily#1}
  22. \newlist{keylist}{description}{1}
  23. \setlist[keylist]{
  24. topsep = 1pt,
  25. labelindent = 1pt,
  26. itemsep = -1ex,
  27. labelwidth = \widthof{xxxxxxxxxxxxxx},
  28. font = \keyify,
  29. leftmargin = !,
  30. before = \color{command}\sffamily
  31. }
  32. \setlength\parindent{0em}
  33. \setlength\parsep{0ex}
  34. \renewcommand\baselinestretch{1.2}
  35. \begin{document}
  36. \begin{multicols}{4}
  37. \setlength{\columnsep}{1cm}
  38. \begin{center}
  39. \LARGE\color{heading}\textbf{Emacs Prelude Cheat Sheet}
  40. \end{center}
  41. \section{Getting Help in Emacs}
  42. \begin{keylist}
  43. \item[C-h k \meta{key}] \humanreadable{describe function bound to \meta{key}}
  44. \item[C-h b] \humanreadable{list key-bindings for focused buffer}
  45. \item[C-h m] \humanreadable{describe mode}
  46. \item[C-h l] \humanreadable{show the keys you have pressed}
  47. \item[C-h f] \humanreadable{describe function}
  48. \end{keylist}
  49. \section{Global}
  50. \begin{keylist}
  51. \item[C-x \textbackslash] align-regexp
  52. \item[C-+] text-scale-increase
  53. \item[C--] text-scale-decrease
  54. \item[C-x O] \humanreadable{go to previous window}
  55. \item[C-x m] eshell
  56. \item[C-x M] \humanreadable{start a new eshell if one is active}
  57. \item[C-x M-m] shell
  58. \item[C-x C-m] smex
  59. \item[C-h A] apropos
  60. \item[C-h C-f] find-function
  61. \item[C-h C-k] find-function-on-key
  62. \item[C-h C-v] find-variable
  63. \item[C-h C-l] find-library
  64. \item[C-h C-i] info-display-manual
  65. \item[C-<backspace>] \humanreadable{kill line backward and indent}
  66. \item[C-o] (isearch-mode) isearch-occur
  67. \item[M-/] hippie-expand
  68. \item[C-x C-b] ibuffer
  69. \item[<f12>] menu-bar-mode
  70. \item[C-x g] magit-status
  71. \item[C-x M-g] magit-dispatch
  72. \end{keylist}
  73. \subsection{prelude}
  74. \humanreadable{Keybindings defined in prelude mode}
  75. \begin{keylist}
  76. \item[C-c o] crux-open-with
  77. \item[C-c g] prelude-google
  78. \item[C-c G] prelude-github
  79. \item[C-c y] prelude-youtube
  80. \item[C-c U] prelude-duckduckgo
  81. \item[C-a] crux-move-beginning-of-line
  82. \item[S-<return>] crux-smart-open-line
  83. \item[M-o] crux-smart-open-line
  84. \item[C-S-<return>] crux-smart-open-line-above
  85. \item[C-S-<up>] move-text-up
  86. \item[C-S-<down>] move-text-down
  87. \item[M-S-<up>] move-text-up
  88. \item[M-S-<down>] move-text-down
  89. \item[C-c n] crux-cleanup-buffer-or-region
  90. \item[C-c f] crux-recentf-ido-find-file
  91. \item[C-M-z] crux-indent-defun
  92. \item[C-c u] crux-view-url
  93. \item[C-c e] crux-eval-and-replace
  94. \item[C-c s] crux-swap-windows
  95. \item[C-c w] prelude-swap-meta-and-super
  96. \item[C-c D] crux-delete-file-and-buffer
  97. \item[C-c d] crux-duplicate-current-line-or-region
  98. \item[C-c M-d] crux-duplicate-and-comment-current-
  99. line-or-region
  100. \item[C-c r] crux-rename-buffer-and-file
  101. \item[C-c t] crux-visit-term-buffer
  102. \item[C-c k] crux-kill-other-buffers
  103. \item[C-c TAB] crux-indent-rigidly-and-copy-
  104. to-clipboard
  105. \item[C-c I] crux-find-user-init-file
  106. \item[C-c S] crux-find-shell-init-file
  107. \item[C-c i] imenu-anywhere
  108. \item[s-p] projectile-command-map
  109. \item[s-r] crux-recentf-ido-find-file
  110. \item[s-j] crux-top-join-line
  111. \item[s-k] crux-kill-whole-line
  112. \item[s-m m] magit-status
  113. \item[s-m l] magit-log
  114. \item[s-m f] magit-log-buffer-file
  115. \item[s-m b] magit-blame
  116. \item[s-o] crux-smart-open-line-above
  117. \end{keylist}
  118. \subsection{ace-window}
  119. \humanreadable{Quickly switch windows in Emacs}
  120. \begin{keylist}
  121. \item[s-w] ace-window
  122. \end{keylist}
  123. \subsection{avy}
  124. \humanreadable{Effectively navigate to visible things}
  125. \begin{keylist}
  126. \item[C-c v] avy-goto-word-or-subword-1
  127. \item[s-.] avy-goto-word-or-subword-1
  128. \end{keylist}
  129. \subsection{anzu}
  130. \humanreadable{Enhances isearch \& query-replace by showing total matches and current match position}
  131. \begin{keylist}
  132. \item[M-\%] anzu-query-replace
  133. \item[s-.] anzu-query-replace-regexp
  134. \end{keylist}
  135. \subsection{browse-kill-ring}
  136. \humanreadable{Smarter kill-ring navigation}
  137. \begin{keylist}
  138. \item[s-y] browse-kill-ring
  139. \end{keylist}
  140. \subsection{crux}
  141. \humanreadable{A Collection of Ridiculously Useful eXtensions for Emacs.}
  142. \begin{keylist}
  143. \item[C-\^] crux-top-join-line
  144. \item[s-k] crux-kill-whole-line
  145. \end{keylist}
  146. \subsection{discover-my-major}
  147. \humanreadable{A quick major mode help with discover-my-major.}
  148. \begin{keylist}
  149. \item[C-h C-m] discover-my-major
  150. \end{keylist}
  151. \subsection{easy-kill}
  152. \humanreadable{Kill \& Mark Things Easily in Emacs.}
  153. \begin{keylist}
  154. \item[M-w] easy-kill
  155. \item[C-M-SPC] easy-mark
  156. \item[C-M-@] easy-mark
  157. \end{keylist}
  158. \subsection{expand-region}
  159. \humanreadable{Increase selected region by semantic units.}
  160. \begin{keylist}
  161. \item[C-=] er/expand-region
  162. \end{keylist}
  163. \subsection{flycheck}
  164. \humanreadable{On the fly syntax checking.}
  165. \begin{keylist}
  166. \item[C-t C-n] flycheck-next-error
  167. \item[C-t C-p] flycheck-previous-error
  168. \end{keylist}
  169. \subsection{projectile}
  170. \humanreadable{Project Interaction Library for Emacs.}
  171. \begin{keylist}
  172. \item[C-c p f] projectile-find-file
  173. \item[C-c p p] projectile-switch-project
  174. \item[C-c p d] projectile-find-dir
  175. \item[C-c p r] projectile-replace
  176. \item[C-c p T] projectile-find-test-file
  177. \item[C-c p s g] projectile-grep
  178. \item[C-c p s s] projectile-ag
  179. \end{keylist}
  180. \subsection{operate-on-number}
  181. \humanreadable{Operate on number at point with arithmetic functions.}
  182. \begin{keylist}
  183. \item[C-c . +] apply-operation-to-number-at-point
  184. \item[C-c . -] apply-operation-to-number-at-point
  185. \item[C-c . *] apply-operation-to-number-at-point
  186. \item[C-c . /] apply-operation-to-number-at-point
  187. \item[C-c . \textbackslash] apply-operation-to-number-at-point
  188. \item[C-c . \textasciicircum] apply-operation-to-number-at-point
  189. \item[C-c . <] apply-operation-to-number-at-point
  190. \item[C-c . >] apply-operation-to-number-at-point
  191. \item[C-c . \#] apply-operation-to-number-at-point
  192. \item[C-c . \%] apply-operation-to-number-at-point
  193. \item[C-c . '] operate-on-number-at-point
  194. \end{keylist}
  195. \subsection{zop-to-char}
  196. \humanreadable{A more powerful alternative to zap-to-char.}
  197. \begin{keylist}
  198. \item[M-z] zop-up-to-char
  199. \item[M-Z] zop-to-char
  200. \end{keylist}
  201. \section{Modules}
  202. \subsection{prelude-ido}
  203. \begin{keylist}
  204. \item[M-x] smex
  205. \item[M-X] smex-major-mode-commands
  206. \end{keylist}
  207. \subsection{prelude-ivy}
  208. \begin{keylist}
  209. \item[C-c C-r] ivy-resume
  210. \item[<f6>] ivy-resume
  211. \item[C-s] swiper
  212. \item[M-x] counsel-M-x
  213. \item[<f1> f] counsel-describe-function
  214. \item[<f1> v] counsel-describe-variable
  215. \item[<f1> l] counsel-find-library
  216. \item[<f1> i] counsel-info-lookup-symbol
  217. \item[<f1> u] counsel-unicode-char
  218. \item[C-c g] counsel-git
  219. \item[C-c j] counsel-git-grep
  220. \item[C-c k] counsel-ag
  221. \item[C-x l] counsel-locate
  222. \item[C-r] (minibuffer) counsel-minibuffer-history
  223. \end{keylist}
  224. \subsection{prelude-helm}
  225. \begin{keylist}
  226. \item[C-c h o] helm-occur
  227. \item[C-c h g] helm-do-grep
  228. \item[C-c h C-c w] helm-wikipedia-suggest
  229. \item[C-c h SPC] helm-all-mark-rings
  230. \item[C-c p h] helm-projectile
  231. \end{keylist}
  232. \subsection{prelude-helm-everywhere}
  233. \begin{keylist}
  234. \item[M-x] helm-M-x
  235. \item[C-c C-m] helm-M-x
  236. \item[M-y] helm-show-kill-ring
  237. \item[C-x b] helm-mini
  238. \item[C-x C-b] helm-buffers-list
  239. \item[C-x C-f] helm-find-files
  240. \item[C-h f] helm-apropos
  241. \item[C-h r] helm-info-emacs
  242. \item[C-h C-l] helm-locate-library
  243. \item[C-c f] (prelude-mode) helm-recentf
  244. \item[C-c C-l] (minibuffer-local) help-minibuffer-history
  245. \item[C-o] (isearch-mode) helm-occur-from-isearch
  246. \item[C-c C-l] (shell-mode) helm-comint-input-ring
  247. \end{keylist}
  248. \subsection{prelude-key-chord}
  249. \begin{keylist}
  250. \item[jj] avy-goto-word-1
  251. \item[jl] avy-goto-line
  252. \item[jk] avy-goto-char
  253. \item[JJ] crux-switch-to-previous-buffer
  254. \item[uu] undo-tree-visualize
  255. \item[xx] execute-extended-command
  256. \item[yy] browse-kill-ring
  257. \end{keylist}
  258. \subsection{prelude-evil}
  259. \begin{keylist}
  260. \item[C-A] (normal-state) evil-numbers/inc-at-pt
  261. \item[C-S-A] (normal-state) evil-numbers/dec-at-pt
  262. \item[>] (visual-state) prelude-shift-right-visual
  263. \item[<] prelude-shift-left-visual
  264. \item[C-S-d] prelude-evil-scroll-down-other-window
  265. \item[C-S-u] prelude-evil-scroll-up-other-window
  266. \item[K] (magit-branch-manager-mode)\\
  267. (emacs-state) magit-discard
  268. \item[L] (magit-branch-manager-mode)\\
  269. (emacs-state) magit-log-popup
  270. \item[K] (magit-status-mode) (emacs-state) magit-discard
  271. \item[l] (magit-status-mode) (emacs-state)\\
  272. magit-log-popup
  273. \item[h] (magit-status-mode) (emacs-state)\\
  274. magit-diff-toggle-refine-hunk
  275. \end{keylist}
  276. \subsection{prelude-emacs-lisp}
  277. \begin{keylist}
  278. \item[C-c C-z] prelude-visit-ielm
  279. \item[C-c C-c] eval-defun
  280. \item[C-c C-b] eval-buffer
  281. \end{keylist}
  282. \subsection{prelude-go}
  283. \begin{keylist}
  284. \item[C-c a] go-test-current-project
  285. \item[C-c m] go-test-current-file
  286. \item[C-c .] go-test-current-test
  287. \item[C-c b] go-run
  288. \item[C-c h] godoc-at-point
  289. \end{keylist}
  290. \subsection{prelude-ocaml}
  291. \begin{keylist}
  292. \item[C-c C-s] utop
  293. \end{keylist}
  294. \subsection{prelude-org}
  295. \begin{keylist}
  296. \item[C-c l] org-store-link
  297. \item[C-c a] org-agenda
  298. \item[C-c b] org-iswitchb
  299. \end{keylist}
  300. \subsection{prelude-rust}
  301. \begin{keylist}
  302. \item[C-c C-d] racer-describe
  303. \item[C-c .] racer-find-definition
  304. \item[C-c ,] pop-tag-mark
  305. \end{keylist}
  306. \end{multicols}
  307. \end{document}
  308. %%% Local Variables:
  309. %%% mode: latex
  310. %%% TeX-master: t
  311. %%% End: