aboutsummaryrefslogtreecommitdiff
path: root/doc/shortcuts.txt
blob: a95e53012f0fe29ab08aa78d8981c266f64a1c12 (plain)
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
leader key      = usually set to backslash expects a quick command


[normal mode]
f{char}         = move cursor to the character {char}
gf              = open file under cursor
<C-w>gf         = open file under cursor in a tab
<C-w>]          = jump to the tag under the cursor in a new window
<C-t>           = jump back from where that ^ brought you




[visual mode]   # with selected lines
gq              = formats text so that it fits in whatever :set textwidth was set
iB              = select block between curly braces (:help object-select)


[commands]
:spell [word]   = adds a word to the current dictionary (no mistake any more)
:set list       = display non printable characters
:retab          = replaces tabs with spaces
:set expandtab  = in insert mode: replace tab with spaces
:Explore        = cli version open file dialog


[navigation]
<CTRL-]>        = look up the tag under the cursor (help links as well)
<CTRL-T>        = return back from tag under the cursor
gd              = jump to the declaration of the variable under the cursor


[macros]        # record and play back a series of vim commands
qa              = start (q) macro recording in register a (can be anything)
q               = stop macro recording
@a              = replay macro a
:'<,'>normal @a = apply a to every line in the current selection


[marker]
ma              = set marker a-z (a in this case)
'a              = go to marker a


[hotkeys]
<C-A>, <C-X>    = increment, decrement number under the cursor


[windows]
<C-W>v          = splits buffer vertically (screen uses |)
<C-W>s          = splits buffer horizontally (same as screen)
<C-W>w          = moves the cursor to the next window and back
<C-W>[dir]      = moves the cursor in that direction (use hjkl or arrow keys)


[vimdiff]
do              = get changes from other window into the current
dp              = put changes from current window into the other
]c              = jump to the next change
[c              = jump to the prevous change
zR              = opens all folds (unfold all)

[vim modeline]
the last line can be a mode line, which holds settings like tab width:


[buffers]
:bn             = buffer next
:bp             = buffer previous
:bd             = buffer dispatch (close)


[special]
g CTRL-g        = display file properties including word and char count

# vim: noai:ts=2:sw=2 filetype=dosini
..