The Absolute Beginner’s Guide to Emacs

Spacemacs: Emacs advanced Kit focused on Evil

Dotnet layer

C# layer

OSX layer

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 v Enter enhanced visual mode

    v expand selection

    V contract selection

  • Text editing

    r replace character under cursor

    R replace on line

    u undo

    R redo

    d w Delete word

    d d Delete line

    D Delete line (leaves whitespace)

    c w Change word

    C Cut from cursor to line end and enter insert mode

    Multiple cursors

    g r m Create cursors on all matching text (having done a / search in file)

    g r q Remove all cursors leaving just the main cursor

    g r h Create cursor at point

    d i [char] Delete all inside char

    d a [char] Delete all including char

    y i [char] “Yank” all inside char

    y a [char] “Yank” all including char

    c s [from] [to] Change surrounding char from - to

    e.g. c s ( { will change surrounding () to {}

    c i [char] Change all inside char

    e.g. c i " will delete all inside nearest opening " to closing " and enter insert mode

    c a [char] Change all including char

    e.g. c a " will delete all from nearest " to closing " and enter insert mode

  • Code navigation

    [number] G Go to line number

    : [number] Go to line number

    g d Go to definition

    g D Go to definition in a new window

    z c Close fold

    z o Open fold

    g c c Comment line

    SPC ; ; Comment line

    v [select] g c c Comment selection

    z c Close fold

    z o Open fold

  • Movement

    M-f forward word

    M-b backward word

    0 Start 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 line

    f [char] Find character forward

    F [char] Find character backward

    C-u Jump up half a page

    C-d Jump 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

Setup Spacemacs with asdf-vm