-
Notifications
You must be signed in to change notification settings - Fork 1
/
vim_outline
50 lines (41 loc) · 1.9 KB
/
vim_outline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
This is an outline of vim .. it should be something to peruse for things you've forgotten or want to practice.
* Windows
- use :vnew to start a new vertical window
- use :new to start a new horizontal window
- use :vsplit to get a copy of current file
- use :split to have horizontal split with copy of current file
- use ctrl-w & a h,j,k,l direction to change window focus
- use ctrl-w | or _ to widen the window with current focus
- use ctrl-w = to equalize the window sizes
* Navigation
- One letter: h,j,k,l
- One word: w,b e,
- Paragraph: [,]
- Page:
- ctrl-d move half a page down
- ctrl-f move page forward
- ctrl-b move page backward
- ctrl-e move up, leave cursor still
- ctrl-y move down, leave cursor still
* Editing
- i insert mode before cursor, a insert mode after cursor
- I insert mode at start of line, A insert mode at end of line
- o insert new line below current line, enter insert mode
- O insert new line above current line, enter insert mode
- J combine next line with current line
- dd delete current line
- dw delete word
- cw change word, delete current word, enter insert mode
* Dictionary, spelling
- set spell -- turn on highligting of spelling errors
- set spell! -- turn off
- set nospell -- turn off
* Managing packages
- use pathogen: https://github.com/tpope/vim-pathogen
* Creating your own magic: macros
- .vimrc is the file where all your settings take place and where you can place permanent 'shortcuts'
- To permanently set a macro at the letter w, put this in your .vimrc
let w='...', e.g. let w='0ibeginAend'
* if you have to use an escape, enter insert mode and <C-p> <escape> will insert the special escape character
- instead of using a macro, this can be mapped to a leader key:
map <leader>f 0ibegin<ESC>Aend