You are on page 1of 6

Notes on emacs

Roberto Vaquerizo

Contents

1 tabulated-mode 2

2 Motion 2

3 tab mode 2

4 Other window 3

5 Other commands 3

6 Mark 3

7 I-Search 3

8 Occur 4

9 Positioning 4

10 Edit 5

11 Transposing 5

12 Regex 5

13 Casing 5

14 Count 5

15 Macros 6

1
1 tabulated-mode

(let ((columns [("Host" 100)])


(rows (mapcar (lambda(x)
(nil [,x])
(split-string (shell-command-to-string "expand-hostclass ENERGONW
(switch-to-buffer "*temp*")
(setq tabulated-list-format columns)
(setq tabulated-list-entries rows)
(tabulated-list-init-header)
(tabulated-list-print)))))
(define-derived-mode hclogs-mode
tabulated-list-mode "Hostclass-logs"
"Hostclass-logs mode"
(let ...)
(defun hclogs()
(interactive)
(stb "*hclogs*")
(hclogs-mode)))

2 Motion

keybinding Action/description
M-m Moves point to the rst non-whitespace character on this line

3 tab mode

ˆ Check out tab-bar-history-mode.

ˆ tab-list : interactive tab list.

keybinding Action/description
C-x t p Run project command in other tab
C-x t d Open dired in other tab
C-x t b Switch to buer in other tab

2
4 Other window

keybinding Action/description
C-x 4 C-f Find le in the other window
C-x 4 d Open dired in the other window
C-x 4 b Switch buer in other window
C-x 4 p Run project command in other window

5 Other commands

keybinding Action/description
C-x o Switch active window
C-/ Undo
C-x u Undo
C-_ Undo

6 Mark

keybinding Action/description
C-<SPC> Set mark and activate
C-<SPC> C-<SPC> Set mark and deactivate
C-u C-<SPC> Return the point to the mark
C-x C-x Exchange point and mark
M-h Marks next paragraph
C-x h Marks whole buer
C-M-h Marks next defun
M-@ Marks next word
C-M-<SPC> Marks next s-expression
C-M-@ Marks next s-expression

7 I-Search

3
keybinding Action/description
C-s / C-r Incremental search / backwards
C-M-s / C-M-r Regex incremental search / backwards
C-s C-s Search the last search string
C-r C-r Backwards isearch against last search string
M-n Next item in search history
M-p Previous item in search history
C-M-i "TAB"-complete search string against previous search ring
C-w Add word at point to search

8 Occur

keybinding Action/description
M-s o Occur mode
M-s o Activate occur mode on current search
M-n / M-p Go to next/previous occurrence
<,> Go to beginning and end of buer
C-r C-r Backwards isearch against last search string
g Revert the buer, refreshing the search results
q Quits occur mode
C-c C-c Exits occur mode and applies changes
C-w Switch to occur-edit mode
M-g M-n Jump to next error
M-g M-p Jump to previous error
multioccur Multiple buers aected

9 Positioning

keybinding Action/description
M-r Repositions the point top, middle, bottom, left
C-l Recenters point middle, top, bottom
M-g / M-g Go to line

4
10 Edit

keybinding Action/description
M-d / C-<backspace> Kill word / backwards
C-S-<backspace> Kill current line
C-w Cut
M-w Copy
C-y Paste
M-y Cycle thru kill ring

11 Transposing

keybinding Action/description
C-t Transpose characters
M-t Transpose words
C-M-t Transpose s-expression
C-x C-t Transpose lines

12 Regex

keybinding Action/description
d.oes not exist Use [0-9] or[:digit:]
\ Alternative
, Capturing group
\, \ Repetition

13 Casing

keybinding Action/description
M-c Capitalizes next word
M-u Uppercases next word
M-l Lowercases next word
M Negative argument

14 Count

keybinding Action/description
M-x count-words Counts words, lines and chars in buer
M-x count-matches Counts number of patterns that match in a region

5
15 Macros

keybinding Action/description
<F3> Starts macro recording
C-u (numeric) <F3> Inserts counter value
<F4> Stops macro recording
C-u (numeric) <F4> Plays last macro
C-x C-k C-a Adds to counter
C-x C-k <TAB> <F3> Inserts counter
C-x C-k C-c Sets counter
C-x C-k C-f Set format counter
M-1 <F3> <F3> <RET> M-9 M-0 <F4> Series, starting in 1, and executed 90 times

You might also like