The Absolute Beginner’s Guide to Emacs
Spacemacs: Emacs advanced Kit focused on Evil
Configuring emacs to use eslint and babel with flycheck for javascript and React.js JSX | CodeWinds
Useful keybindings
Reading keybindings:
C-[something] C in this context is Ctrl , so it would be Ctrl + whatever in square braces
M-[something] M in this context is “Meta”, option on mac keyboard, Alt on Windows keyboard
-
Visual mode
SPC vEnter enhanced visual modevexpand selectionVcontract selection -
Text editing
rreplace character under cursorRreplace on lineuundoRredod wDelete wordd dDelete lineDDelete line (leaves whitespace)c wChange wordCCut from cursor to line end and enter insert modeMultiple cursors
g r mCreate cursors on all matching text (having done a/search in file)g r qRemove all cursors leaving just the main cursorg r hCreate cursor at pointd i [char]Delete all inside chard a [char]Delete all including chary i [char]“Yank” all inside chary a [char]“Yank” all including charc s [from] [to]Change surrounding char from - toe.g.
c s ( {will change surrounding()to{}c i [char]Change all inside chare.g.
c i "will delete all inside nearest opening"to closing"and enter insert modec a [char]Change all including chare.g.
c a "will delete all from nearest"to closing"and enter insert mode -
Code navigation
[number] GGo to line number: [number]Go to line numberg dGo to definitiong DGo to definition in a new windowz cClose foldz oOpen foldg c cComment lineSPC ; ;Comment linev [select] g c cComment selectionz cClose foldz oOpen fold -
Movement
M-fforward wordM-bbackward word0Start of line^Start of non-whitespace$End of non-whitespace%Jump forward to next paren, further%toggles between open and close parens{Jump to previous empty line}Jump to next empty linef [char]Find character forwardF [char]Find character backwardC-uJump up half a pageC-dJump down half a page
Useful commands
whitespace-cleanup does what it says on the tin
Problems I’ve had:
Starting eslint server
Unknown command: `asdf exec node .../path/to/eslintServer.js`Fix:
Manually delete .spacemacs.env and regenerate: SPC f e E