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.

350 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[<f11>] prelude-fullscreen
  70. \item[<f12>] menu-bar-mode
  71. \item[C-x g] magit-status
  72. \item[C-x M-g] magit-dispatch
  73. \end{keylist}
  74. \subsection{prelude}
  75. \humanreadable{Keybindings defined in prelude mode}
  76. \begin{keylist}
  77. \item[C-c o] crux-open-with
  78. \item[C-c g] prelude-google
  79. \item[C-c G] prelude-github
  80. \item[C-c y] prelude-youtube
  81. \item[C-c U] prelude-duckduckgo
  82. \item[C-a] crux-move-beginning-of-line
  83. \item[S-<return>] crux-smart-open-line
  84. \item[M-o] crux-smart-open-line
  85. \item[C-S-<return>] crux-smart-open-line-above
  86. \item[C-S-<up>] move-text-up
  87. \item[C-S-<down>] move-text-down
  88. \item[M-S-<up>] move-text-up
  89. \item[M-S-<down>] move-text-down
  90. \item[C-c n] crux-cleanup-buffer-or-region
  91. \item[C-c f] crux-recentf-ido-find-file
  92. \item[C-M-z] crux-indent-defun
  93. \item[C-c u] crux-view-url
  94. \item[C-c e] crux-eval-and-replace
  95. \item[C-c s] crux-swap-windows
  96. \item[C-c w] prelude-swap-meta-and-super
  97. \item[C-c D] crux-delete-file-and-buffer
  98. \item[C-c d] crux-duplicate-current-line-or-region
  99. \item[C-c M-d] crux-duplicate-and-comment-current-
  100. line-or-region
  101. \item[C-c r] crux-rename-buffer-and-file
  102. \item[C-c t] crux-visit-term-buffer
  103. \item[C-c k] crux-kill-other-buffers
  104. \item[C-c TAB] crux-indent-rigidly-and-copy-
  105. to-clipboard
  106. \item[C-c I] crux-find-user-init-file
  107. \item[C-c S] crux-find-shell-init-file
  108. \item[C-c i] imenu-anywhere
  109. \item[s-p] projectile-command-map
  110. \item[s-r] crux-recentf-ido-find-file
  111. \item[s-j] crux-top-join-line
  112. \item[s-k] crux-kill-whole-line
  113. \item[s-m m] magit-status
  114. \item[s-m l] magit-log
  115. \item[s-m f] magit-log-buffer-file
  116. \item[s-m b] magit-blame
  117. \item[s-o] crux-smart-open-line-above
  118. \end{keylist}
  119. \subsection{ace-window}
  120. \humanreadable{Quickly switch windows in Emacs}
  121. \begin{keylist}
  122. \item[s-w] ace-window
  123. \end{keylist}
  124. \subsection{avy}
  125. \humanreadable{Effectively navigate to visible things}
  126. \begin{keylist}
  127. \item[C-c j] avy-goto-word-or-subword-1
  128. \item[s-.] avy-goto-word-or-subword-1
  129. \end{keylist}
  130. \subsection{anzu}
  131. \humanreadable{Enhances isearch \& query-replace by showing total matches and current match position}
  132. \begin{keylist}
  133. \item[M-\%] anzu-query-replace
  134. \item[s-.] anzu-query-replace-regexp
  135. \end{keylist}
  136. \subsection{browse-kill-ring}
  137. \humanreadable{Smarter kill-ring navigation}
  138. \begin{keylist}
  139. \item[s-y] browse-kill-ring
  140. \end{keylist}
  141. \subsection{crux}
  142. \humanreadable{A Collection of Ridiculously Useful eXtensions for Emacs.}
  143. \begin{keylist}
  144. \item[C-\^] crux-top-join-line
  145. \item[s-k] crux-kill-whole-line
  146. \end{keylist}
  147. \subsection{discover-my-major}
  148. \humanreadable{A quick major mode help with discover-my-major.}
  149. \begin{keylist}
  150. \item[C-h C-m] discover-my-major
  151. \end{keylist}
  152. \subsection{easy-kill}
  153. \humanreadable{Kill \& Mark Things Easily in Emacs.}
  154. \begin{keylist}
  155. \item[M-w] easy-kill
  156. \item[C-M-SPC] easy-mark
  157. \item[C-M-@] easy-mark
  158. \end{keylist}
  159. \subsection{expand-region}
  160. \humanreadable{Increase selected region by semantic units.}
  161. \begin{keylist}
  162. \item[C-=] er/expand-region
  163. \end{keylist}
  164. \subsection{flycheck}
  165. \humanreadable{On the fly syntax checking.}
  166. \begin{keylist}
  167. \item[C-t C-n] flycheck-next-error
  168. \item[C-t C-p] flycheck-previous-error
  169. \end{keylist}
  170. \subsection{projectile}
  171. \humanreadable{Project Interaction Library for Emacs.}
  172. \begin{keylist}
  173. \item[C-c p f] projectile-find-file
  174. \item[C-c p p] projectile-switch-project
  175. \item[C-c p d] projectile-find-dir
  176. \item[C-c p r] projectile-replace
  177. \item[C-c p T] projectile-find-test-file
  178. \item[C-c p s g] projectile-grep
  179. \item[C-c p s s] projectile-ag
  180. \end{keylist}
  181. \subsection{operate-on-number}
  182. \humanreadable{Operate on number at point with arithmetic functions.}
  183. \begin{keylist}
  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 . /] apply-operation-to-number-at-point
  188. \item[C-c . \textbackslash] apply-operation-to-number-at-point
  189. \item[C-c . \textasciicircum] 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 . \%] apply-operation-to-number-at-point
  194. \item[C-c . '] operate-on-number-at-point
  195. \end{keylist}
  196. \subsection{zop-to-char}
  197. \humanreadable{A more powerful alternative to zap-to-char.}
  198. \begin{keylist}
  199. \item[M-z] zop-up-to-char
  200. \item[M-Z] zop-to-char
  201. \end{keylist}
  202. \section{Modules}
  203. \subsection{prelude-ido}
  204. \begin{keylist}
  205. \item[M-x] smex
  206. \item[M-X] smex-major-mode-commands
  207. \end{keylist}
  208. \subsection{prelude-ivy}
  209. \begin{keylist}
  210. \item[C-c C-r] ivy-resume
  211. \item[<f6>] ivy-resume
  212. \item[C-s] swiper
  213. \item[M-x] counsel-M-x
  214. \item[<f1> f] counsel-describe-function
  215. \item[<f1> v] counsel-describe-variable
  216. \item[<f1> l] counsel-find-library
  217. \item[<f1> i] counsel-info-lookup-symbol
  218. \item[<f1> u] counsel-unicode-char
  219. \item[C-c g] counsel-git
  220. \item[C-c j] counsel-git-grep
  221. \item[C-c k] counsel-ag
  222. \item[C-x l] counsel-locate
  223. \item[C-r] (minibuffer) counsel-minibuffer-history
  224. \end{keylist}
  225. \subsection{prelude-helm}
  226. \begin{keylist}
  227. \item[C-c h o] helm-occur
  228. \item[C-c h g] helm-do-grep
  229. \item[C-c h C-c w] helm-wikipedia-suggest
  230. \item[C-c h SPC] helm-all-mark-rings
  231. \item[C-c p h] helm-projectile
  232. \end{keylist}
  233. \subsection{prelude-helm-everywhere}
  234. \begin{keylist}
  235. \item[M-x] helm-M-x
  236. \item[C-c C-m] helm-M-x
  237. \item[M-y] helm-show-kill-ring
  238. \item[C-x b] helm-mini
  239. \item[C-x C-b] helm-buffers-list
  240. \item[C-x C-f] helm-find-files
  241. \item[C-h f] helm-apropos
  242. \item[C-h r] helm-info-emacs
  243. \item[C-h C-l] helm-locate-library
  244. \item[C-c f] (prelude-mode) helm-recentf
  245. \item[C-c C-l] (minibuffer-local) help-minibuffer-history
  246. \item[C-o] (isearch-mode) helm-occur-from-isearch
  247. \item[C-c C-l] (shell-mode) helm-comint-input-ring
  248. \end{keylist}
  249. \subsection{prelude-key-chord}
  250. \begin{keylist}
  251. \item[jj] avy-goto-word-1
  252. \item[jl] avy-goto-line
  253. \item[jk] avy-goto-char
  254. \item[JJ] crux-switch-to-previous-buffer
  255. \item[uu] undo-tree-visualize
  256. \item[xx] execute-extended-command
  257. \item[yy] browse-kill-ring
  258. \end{keylist}
  259. \subsection{prelude-evil}
  260. \begin{keylist}
  261. \item[C-A] (normal-state) evil-numbers/inc-at-pt
  262. \item[C-S-A] (normal-state) evil-numbers/dec-at-pt
  263. \item[>] (visual-state) prelude-shift-right-visual
  264. \item[<] prelude-shift-left-visual
  265. \item[C-S-d] prelude-evil-scroll-down-other-window
  266. \item[C-S-u] prelude-evil-scroll-up-other-window
  267. \item[K] (magit-branch-manager-mode)\\
  268. (emacs-state) magit-discard
  269. \item[L] (magit-branch-manager-mode)\\
  270. (emacs-state) magit-log-popup
  271. \item[K] (magit-status-mode) (emacs-state) magit-discard
  272. \item[l] (magit-status-mode) (emacs-state)\\
  273. magit-log-popup
  274. \item[h] (magit-status-mode) (emacs-state)\\
  275. magit-diff-toggle-refine-hunk
  276. \end{keylist}
  277. \subsection{prelude-emacs-lisp}
  278. \begin{keylist}
  279. \item[C-c C-z] prelude-visit-ielm
  280. \item[C-c C-c] eval-defun
  281. \item[C-c C-b] eval-buffer
  282. \end{keylist}
  283. \subsection{prelude-go}
  284. \begin{keylist}
  285. \item[C-c a] go-test-current-project
  286. \item[C-c m] go-test-current-file
  287. \item[C-c .] go-test-current-test
  288. \item[C-c b] go-run
  289. \item[C-c h] godoc-at-point
  290. \end{keylist}
  291. \subsection{prelude-ocaml}
  292. \begin{keylist}
  293. \item[C-c C-s] utop
  294. \end{keylist}
  295. \subsection{prelude-org}
  296. \begin{keylist}
  297. \item[C-c l] org-store-link
  298. \item[C-c a] org-agenda
  299. \item[C-c b] org-iswitchb
  300. \end{keylist}
  301. \subsection{prelude-rust}
  302. \begin{keylist}
  303. \item[C-c C-d] racer-describe
  304. \item[C-c .] racer-find-definition
  305. \item[C-c ,] pop-tag-mark
  306. \end{keylist}
  307. \end{multicols}
  308. \end{document}
  309. %%% Local Variables:
  310. %%% mode: latex
  311. %%% TeX-master: t
  312. %%% End: