Skip to content

Latest commit

 

History

History
165 lines (147 loc) · 6.12 KB

README.md

File metadata and controls

165 lines (147 loc) · 6.12 KB

Emacs

overview

My personal Emacs configuration used mostly for JavaScript development.

Node.js is required for JavaScript syntax checking.

Installation

  1. Download repository.
  2. Symlink or copy ./configs/.emacs and ./configs/.emacs.d to your home directory.
  3. Install TSlint

Included packages

Key bindings

  • Movement

    • Ctrl + f - move forward
    • Ctrl + b - move backward
    • Ctrl + n - move to next line
    • Ctrl + p - move to previous line
    • Ctrl + a - move to beginning of the line
    • Ctrl + e - move to ending of the line
    • Alt + f - move word forward
    • Alt + b - move word backward
    • Alt + right arrow - move forward (semantic)
    • Alt + left arrow - move backward (semantic)
    • Alt + up arrow - move up (semantic)
    • Alt + down arrow - move down (semantic)
    • Alt + < - move to beginning of the file
    • Alt + > - move to ending of the file
    • Ctrl + v - scroll down
    • Alt + v - scroll up
    • Alt + p - move line/region up
    • Alt + n - move line/region down
    • up arrow - jump to line with number
  • Selection

    • Ctrl + space - enter/exit text selection mode
    • Ctrl + . - mark next like this
    • Ctrl + , - mark previous like this
    • Ctrl + j - new line for many cursors
    • Alt + s - expand selection, then by pressing s expand it wider
    • Ctrl + x + p - select all
    • Alt + . - add another cursor forward/below
    • Alt + , - add another cursor backward/up
  • History and search

    • Alt + w - copy
    • Ctrl + k - cut
    • Ctrl + y - paste, then by pressing Alt + y paste previously copied text
    • Left arrow - undo
    • Right arrow - redo
    • Ctrl + s - Isearch (forward, case sensitive)
    • Ctrl + r - Isearch (backward, case sensitive)
    • Alt + c - switch to case insensitive Isearch
    • Alt + g - recursive grep
  • Text removal

    • Alt + backspace - remove word backward
    • Alt + d - remove word forward
    • Ctrl + d - remove character forward
  • Files and console

    • Ctrl + c p f - search file
    • Ctrl + l - search file (helm)
    • Alt + l - search buffer (helm)
    • Alt + x - search command (helm)
    • Ctrl + x b - search through open files
    • Alt + x - open console
    • Ctrl + x Ctrl + f - browse files
    • Ctrl + r - next
    • Ctrl + s - previous
  • Avy

    • Ctrl + space - go to word (two letters)
    • Ctrl + w - go to word (one letter)
    • Ctrl + l - go to line
  • JavaScript

    • f tab - anonymous function snippet
    • fn tab - named function snippet
    • i tab - if snippet
    • ie tab - if else snippet
    • Ctrl + c i - js function description comment
  • Windows

    • Ctrl + x 3 - split screen vertically
    • Ctrl + x 2 - split screen horizontally
    • Ctrl + x o - move to next window
    • Ctrl + x 0 - close window
    • Ctrl + x Ctrl + o - rotate buffer windows
  • Helm buffer list

    • Alt + l - open list
    • Ctrl + Space - mark buffers on the list
    • Alt + Shift + d - kill marked buffers and close Helm
  • TypeScript/Angular

    • Ctrl + c Ctrl + c - open component counterpart
    • Ctrl + c j - jump to html binding (inside a template)
    • Ctrl + c j - jump to definition (inside a TypeScript file)
    • Ctrl + c r s - rename symbol
    • Ctrl + c r f - rename file
  • Bookmarks

    • Ctrl + c b l - open list of bookmarks
    • Ctrl + c b a - add a bookmark
    • Ctrl + c b d - delete a bookmark
    • Ctrl + c b r - rename a bookmark
  • Other

    • Alt + ; - comment/uncomment line/selection
    • Ctrl + x u - open undo-tree buffer
    • Alt + m - open magit status buffer
    • down arrow - count lines, words and characters
    • Ctrl + c Ctrl + s - cycle between different ways of writing strings (camelCase, kebab_case etc.)
    • Alt + r - open rgrep

Credits

Great thanks to Andrzej for showing me emacs, what made me immediately hooked.