-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
119 lines (106 loc) · 5.86 KB
/
README
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
F2 Tags (Fzf)
F3 Recently Used Files (Fzf)
F3-S Buffers (Fzf)
F4 Close buffer
F6 Jump between source (.c) and headers files (.h)
F7 Close quickfix list (:ccl)
F8 Write all buffers and Make
F8-S Write current buffer and Make
F9 TaskList: view TODOs, etc. in current file
F10 Tag list - code structure
gv Re-select last visual selection
gf Open filename under cursor
gq<MOTION> Format lines. Like = for comments. e.g. enforce text width, move words between lines, etc.
\* Recursive grep for symbol under cursor. (TODO: remap to use ack, remove vim-visual-star)
gc<MOTION>/gcc Commentary: Comment out a motion/line
\<Space>[N] X Easy Align [V mode] - aligns selection about the Nth 'X'. (N is optional)
\ <MOTION> Easy Align [N mode] - as above, but with a motion. e.g. '\ 4j'
mX Set mark X to cursor position
`X Go to mark X (as indicated in gutter)
^W<ARROW> Go to window in <DIR>
^Wq Close current window
^T / ^D [I mode]: (un)indent the current line
^W / ^U [I mode]: delete the last word/line
^Y / ^E [I mode]: insert the character in the same column, above/below line
zf/zc/zo/za Create/close/open/toggle a fold
zm/zr Close/open a level of folds. (more/reduce folding)
ai/ii Text object for block of indented code, optionally including the previous unindented line. Cursor must be inside indented block.
gn Text object for search result
\s / \S Skip to point half-way between cursor and end/start of line (vim-skip)
\gs Go to midpoint of line (vim-skip)
[i / [I Show the definition of / all references to the identifier under the cursor. (Useful for checking types)
gd / gD Go to the definition of the current identifier in the current file / function.
z/ / z? Forward/backward fuzzy search
\\ft Set filetype (fzf.vim)
SURROUND.VIM
ys<MOTION>] Surround MOTION with ] brackets (use left bracket to add spaces). Supports XML tags as well.
yss] Surround line with ] brackets
csAB Change delimeter 'A' to 'B'. e.g. cs'"
ds] Delete surrounding [] brackets
S [V mode]: surround selection
VIM-ABOLISH
crs Coerce to snake_case
crc Coerce to camelCase
crm Coerce to MixedCase
cru Coerce to UPPER_CASE
VIM-UNIMPAIRED
]q Next error (:cn). Capitalise to go to first/last.
]b Next buffer (:bn, <C-Tab>).
]t Next tag (:tn)
]n Next git merge conflict marker. Use :diffget to select hunks.
]<Space> Add (COUNT) blank lines below the cursor. Use [ for above.
]e Move the current line (count) lines down. Use [ for above.
coc/cou/cox Toggle cursor line/col/both.
col Toggle list mode (displays unprintable chars, ends lines with $)
cos Toggle spell check.
cow Toggle line wrap
yi/ya/yo... Prefix any insert-mode entering command with y to enter paste mode.
[x XML encode. Prefix with count or append motion. ] decodes.
[u URL encode.
[y C string encode/escape.
VIM-GITGUTTER
]h Next git hunk
\gg Toggle Git gutter signs (may require buffer to be reopened)
\ga / \gr / \gp Stage (add) / Reset (remove) / Preview the current hunk to/fromt the index.
\cd Switch between file and project root directories. (vim-rooter)
\atw Toggle airline inconsistent whitespace detection.
MULTIPLE CURSORS
<C-n> Select current word, and go to next instance of word (*)
<C-p> Deselect current word and go to previous word
<C-x> Deselect current word and go to next word
PYTHON SPECIFIC - PYMODE/ROPE
<C-Space> Autocomplete (code aware)
<C-C>g Go to definition
<C-C>d Show documentation in panel
<C-c>f Find references
]m Go to next function
iM text object: inside method
iC text object: inside class
LATEX SPECIFIC - LATEX-BOX, ATP-VIM. See http://atp-vim.sourceforge.net/atp_quickref.pdf
F5 View PDF
F8 Compile
F10 Open table of contents
]s Next misspelled word
zg Add word to spellfile
z= View options for the current word. Can also use <C-X>S in insert mode.
1z= Replace the current word with the most likely candidate
:spellrepall Repeat z= for all other instances of that word.
DEBUGGING (see :help vebugger-keymaps)
:VBGstartGDB Start debugger (requires executable name as arg, supports D, PDB, etc.)
:VBGkill Stop debugger (alternatively, just let program terminate)
\di \do \dO Step In/Over/Out
\dc Continue
\db Toggle current line as breakpoint
\dB Clear all breakpoints
\de Evaluate the word (e.g. variable) under the cursor / selected
\dE Evaluate an arbitrary expression
\dx \dX Execute the current line / an arbitrary expression.
:abbreviate Adds insert-mode aliases for longer words. Useful for misspellings.
:<RANGE>Subvert/foo/bar/g Swap foo and bar. Can use f{o,a}r to handle for+far at once. (vim-abolish)
:Ack/:LAck Runs ack, puts results in quickfix/location window
:Remove, :Move, :Chmod Affect the file in the current buffer, updating the buffer to match.
:Find Runs find, loads results into quickfix list
:GraphvizInteractive Auto-updating view for graphs
:SSave / :SLoad / :SDelete Session management (built-in to Startify, auto-updating)
^K / :digraphs Insert non-ASCII characters
:r! / :w! / :! Pipe a selection into / replace with / both a process