Link: Emacs

Book

Practical Vim

Practical guide of vim.

Vim keybinding shortcut

Vim Cheat Sheet

Overall meaning: w: word e: end

Move

0jump to beginning of (visual) line
gjump to end of line
^ or _jump to beginning of line

Edit

Iinsert at the beginning of line
Ainsert at the end of line
xdelete at the cursor
Ocreate new line above

Surround.vim

For Emacs, install evil-surround - MELPA

Add parenthesis

How to add parenthesis like () around highlighted text in visual mode:

  • Select the text in visual mode, e.g. viw to highlight a word
  • Sb or S) to insert bracket wo space; S( to insert bracket with space surrounding

Edit existing parenthesis

  • Change parens: e.g. cs"' change parens from ” to ’
  • Delete parens: ds" delete surrounding ”