-
Notifications
You must be signed in to change notification settings - Fork 0
/
ref.vim
89 lines (88 loc) · 2.86 KB
/
ref.vim
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
" Vim Reference {{{
"
" % -- current filename
" %:p -- current filepath
" $VIMRUNTIME -- /{colors,syntax,macros}
" ListMappings -- list commented mappings
" :map -- list actual mappings
" :scriptnames -- list scripts and plugins
" :set -- list all nondefault options
" e <path> -- open file
" e <pa...><tab> -- open file with wildmenu completion
" \e [...] <enter> -- open file
" :tabnew <path> -- open file
" :read filename| -- insert filename at cursor
" :read !cmd -- insert cmd output at cursor
" :%! [cmd] -- buffer > stdin > [cmd] > stdout => buffer.replace
"
" [n]G -- goto line #
" g ctrl-g -- whereami
" u -- undo
" ^r -- redo
" :%s:\(.*\):+\1:g -- Regex
"
" Modes
" i -- insert
" I -- insert at beginning of line
" a -- append
" A -- append at end of line
" v -- visual
" c-v -- vertical visual block
" V -- visual line
" ;; -- command
" <Esc> -- command
"
" Vim Marks
" m[a-z]{1} -- set mark
" `[a-z]{1} -- goto mark
" '[a-z]{1} -- goto mark
"
" Macros
" q[a-z]{1} -- start recording
" q -- stop recording
" @[a-z]{1} -- replay macro
" @@ -- repeat macro
" q2<seq><esc>q;@2 -- record macro to 2 and repeat
"
" Searching
" /<pattern> -- forvard search for term
" ?<pattern> -- backward search
" * -- search for term under cursor next
" # -- search for term under cursor previous
" n -- next search ocurrence
" N -- previous search ocurrence
" :%s/old/new/g -- find and replace
" :%s/old/new/gc -- find and replace with confirmation
"
" :[l][vim]grep <pattern> <file>
"
" :cl, :ll -- list list
" :copen,lopen [h] -- open list
" :cw, :lw -- toggle show list
" :ccl[ose], lcl -- close list
" :cn, :ln -- next <Enter>
" :cp, :lp -- prev <Enter>
" :cc!, :lc [nr] -- jump to [nr]
" :cfir,:cla -- first, last
"
" Yanking and Pasting
" y[a-z] -- yank to buffer [a-z]
" p[a-z] -- paste from buffer [a-z]
" ]p -- paste to level
"
" Indenting/Shifting Blocks
" [n]< -- shift block left
" [n]> -- shift block right
"
"
" Folding
" :help Fold -- also usr_28
" zf -- create fold
" zo -- fold open
" zO -- fold open recursive
" zc -- fold close
" zC -- fold close recursive
" zx -- undo manual fold actions
" zX -- undo manual fold actions and recompute
" zR -- open all folds
" }}}