2017-11-01 17:16:49 +01:00
|
|
|
# Running emacs
|
|
|
|
|
|
|
|
GUI mode $ emacs
|
|
|
|
Terminal mode $ emacs -nw
|
|
|
|
|
2013-08-29 12:38:22 +02:00
|
|
|
# Basic usage
|
|
|
|
|
|
|
|
Indent Select text then press TAB
|
|
|
|
Cut CTRL-w
|
|
|
|
Copy ALT-w
|
2016-09-01 02:10:21 +02:00
|
|
|
Paste ("yank") CTRL-y
|
2017-03-12 15:19:47 +01:00
|
|
|
Begin selection CTRL-SPACE
|
2013-08-29 12:38:22 +02:00
|
|
|
Search/Find CTRL-s
|
|
|
|
Replace ALT-% (ALT-SHIFT-5)
|
|
|
|
Save CTRL-x CTRL-s
|
2017-09-05 19:26:23 +02:00
|
|
|
Save as CTRL-x CTRL-w
|
2013-08-29 12:38:22 +02:00
|
|
|
Load/Open CTRL-x CTRL-f
|
|
|
|
Undo CTRL-x u
|
|
|
|
Highlight all text CTRL-x h
|
|
|
|
Directory listing CTRL-x d
|
2016-09-01 02:10:21 +02:00
|
|
|
Cancel a command CTRL-g
|
2013-08-29 12:38:22 +02:00
|
|
|
Font size bigger CTRL-x CTRL-+
|
|
|
|
Font size smaller CTRL-x CTRL--
|
|
|
|
|
2017-11-01 17:16:49 +01:00
|
|
|
# Buffers
|
2013-08-29 12:38:22 +02:00
|
|
|
|
|
|
|
Split screen vertically CTRL-x 2
|
|
|
|
Split screen vertically with 5 row height CTRL-u 5 CTRL-x 2
|
|
|
|
Split screen horizontally CTRL-x 3
|
|
|
|
Split screen horizontally with 24 column width CTRL-u 24 CTRL-x 3
|
|
|
|
Revert to single screen CTRL-x 1
|
|
|
|
Hide the current screen CTRL-x 0
|
2017-09-05 19:26:23 +02:00
|
|
|
Move to the next screen CTRL-x o
|
|
|
|
Kill the current buffer CTRL-x k
|
2013-08-29 12:38:22 +02:00
|
|
|
Select a buffer CTRL-x b
|
|
|
|
Run command in the scratch buffer CTRL-x CTRL-e
|
|
|
|
|
2017-05-28 22:46:22 +02:00
|
|
|
# Navigation ( backward / forward )
|
|
|
|
|
|
|
|
Character-wise CTRL-b , CTRL-f
|
|
|
|
Word-wise ALT-b , ALT-f
|
|
|
|
Line-wise CTRL-p , CTRL-n
|
|
|
|
Sentence-wise ALT-a , ALT-e
|
|
|
|
Paragraph-wise ALT-{ , ALT-}
|
|
|
|
Function-wise CTRL-ALT-a , CTRL-ALT-e
|
|
|
|
Line beginning / end CTRL-a , CTRL-e
|
|
|
|
|
2013-08-29 12:38:22 +02:00
|
|
|
# Other stuff
|
|
|
|
|
2016-11-27 16:31:49 +01:00
|
|
|
Open a shell ALT-x eshell
|
2013-08-29 12:38:22 +02:00
|
|
|
Goto a line number ALT-x goto-line
|
|
|
|
Word wrap ALT-x toggle-word-wrap
|
|
|
|
Spell checking ALT-x flyspell-mode
|
|
|
|
Line numbers ALT-x linum-mode
|
|
|
|
Toggle line wrap ALT-x visual-line-mode
|
|
|
|
Compile some code ALT-x compile
|
|
|
|
List packages ALT-x package-list-packages
|
|
|
|
|
|
|
|
# Line numbers
|
|
|
|
|
|
|
|
To add line numbers and enable moving to a line with CTRL-l:
|
|
|
|
|
|
|
|
(global-set-key "\C-l" 'goto-line)
|
|
|
|
(add-hook 'find-file-hook (lambda () (linum-mode 1)))
|