Link: Emacs
Book
Practical Vim
Practical guide of vim.
Vim keybinding shortcut
Overall meaning: w: word e: end
Move
| 0 | jump to beginning of (visual) line |
|---|---|
| g | jump to end of line |
| ^ or _ | jump to beginning of line |
Edit
| I | insert at the beginning of line |
|---|---|
| A | insert at the end of line |
| x | delete at the cursor |
| O | create 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.
viwto highlight a word SborS)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 ”
Append yank to one register
“Ay ;; append to register A “Ay ;; do it again, and now both copies are in A
It’ll append to the existing content in register A, instead of overwriting it. Useful if you want to accumulate multiple lines or snippets into one register. **