-
Notifications
You must be signed in to change notification settings - Fork 1
/
vscode-reference.txt
105 lines (85 loc) · 3.96 KB
/
vscode-reference.txt
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
## Setup
1) run install.sh
2) run vscode-install-extensions.sh
3) install recommended extensions as desired (should be obvious)
## General
As much as possible, my vim maps have been maintained
C = Ctrl, A = Alt, S = Shift
C-q - quit VSCode
C-p - all (most) purpose search. Covers everything put file contents searching
C-S-p - open command palette (equiv to C-p>)
C-` - toggle the terminal (C-S-` for a new terminal)
C-S-[kj] - shift to previous/next terminal when term in focus
C-S-m - open the problems list
C-b - toggle the sidebar open/closed
C-j - close the bottom panel
C-l - toggle relative line numbers
C-/ - toggle line comment (C-S-a for block comment)
C-Enter - open file (from explorer or CtrlP) in vertical split
gh - hover, synonym for S-k
C-. - quick fix (under cursor, so use gn/gp, then C-.)
F2 - rename var under cursor. VSCodeVim complains about not handling r when
we use our normal <leader>r map, so just get used to using the VSCode way
C-k w - Close all editors in a group. This is useful to emulate vim behavior
of closing a split completely on :q. VSCode likes to open new tabs
for each file in a split (but not for the main group, unless an
enablePreview setting is configured to false)
C-k z - Enter zen mode
; - filter opened editors. this is different from denite in some important
ways:
1) in opens in the group the editor is opened in, not in the active
group
2) because of (1), it isn't possible to open files selected this way in
a new group
given these issues, C-p is generally more intuitive if multiple groups
are open
A-S-right/left - right expands the selection (words, bracket contents, blocks,
functions, etc.) and left shrinks it
## Explorer
Note that my vim movement keys are bound here
C-n - open the explorer panel (also C-S-e)
a - in the panel, create a new file
f - in the panel, create a new folder
d - in the panel, delete the selected node
## Marks
Work a little differently than in vim. I have m/' a-j bound, but the actual
bookmarks are numbered. The prefix Numbered Bookmarks: from the command palette
provides the listing and clearing operations. Operations on going to bookmarks
(e.g. d'a) obviously will not work
## Searching
C-S-f - search all files. in v-mode, seed with selected text
C-S-h - replace in all files. in v-mode, seed with selected text
(S-)F4 - go forwards (backwards) through search results
# Folding
NOTE: spending a short amount of time with the cursor inside a fold
will automatically open it in VSCode. Also, these are all vim
mappings, but they are also the only functioning mappings in
VSCodeVim
zM - close all folds
zR - open all folds
zo - open under cursor
zO - open all under cursor (recursively)
zc - close under cursor
zC - close all under cursor (recursively)
za - toggle under cursor
## Git
Most of these are obvious, so no need to write them down. Record any
non-obvious commands or shortcuts here.
NOTE: For multiline commit messages, use the sidebar, *not* the command palette
C-S-g g - open the SCM pane. Note that GitLens turns this into a chord
to add other functionality. It's just C-S-g by default.
Git:Open changes - bring up diff view
Git:Discard (all) changes - checkout HEAD / reset --hard
<leader>hs - stage selected change (line or selection). this is slightly
different than gitgutter, which stages the contiguous change.
this shortcut is only available in the changes view
<leader>hu - undo change. works the same way as staging
[c - move to previous change. works in both editor and compare editor
]c - move to next change. same note as above
# Terminals
C-` - toggle the terminal (C-S-` for a new terminal group)
C-S-[kj] - shift to previous/next terminal group when term in focus
A-left/right/up/down/h/l/k/j - switch between terminals within group
C-a t - select terminal (also C-p, then "term ")
C-a s - split active terminal
C-a r - rename active terminal (also F2 when terminals tabs focused)