Skip to content

Commit acb0827

Browse files
author
Keisuke KATO
authored
fixed #23 (#25)
1 parent ab2f3f5 commit acb0827

File tree

3 files changed

+83
-73
lines changed

3 files changed

+83
-73
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ alt+q | ctrl+shift+q | Context info | N/A
3333
alt+enter | alt+enter | Show intention actions and quick-fixes | ✅
3434
ctrl+y | cmd+backspace | Delete line at caret | ✅
3535
ctrl+alt+l | cmd+alt+l | Reformat code | ✅
36+
ctrl+alt+l | cmd+alt+l | Reformat selected code | ✅
3637
ctrl+alt+o | ctrl+alt+o | Optimize imports | N/A
3738
ctrl+alt+i | ctrl+alt+i | Auto-indent line(s) | N/A
3839
tab | tab | Indent selected lines | N/A
@@ -143,8 +144,8 @@ ctrl+shift+h | cmd+shift+h | Method hierarchy | N/A
143144
ctrl+alt+h | ctrl+alt+h | Call hierarchy | N/A
144145
f2 | f2 | Next highlighted error | N/A
145146
shift+f2 | shift+f2 | Previous highlighted error | N/A
146-
f4 | f4 | Edit source | N/A
147-
ctrl+enter | cmd+down | View source | N/A
147+
f4 | f4 | Edit source |
148+
ctrl+enter | cmd+down | View source |
148149
alt+home | alt+home | Show navigation bar | N/A
149150
f11 | f3 | Toggle bookmark | N/A
150151
ctrl+f11 | alt+f3 | Toggle bookmark with mnemonic | N/A
@@ -219,8 +220,8 @@ shift+ctrl+enter | shift+cmd+enter | Start new line | ✅
219220
1. Install Visual Studio Code 1.6.0 or higher
220221
1. Launch Code
221222
1. From the command palette `Ctrl`-`Shift`-`P` (Windows, Linux) or `Cmd`-`Shift`-`P` (macOS)
222-
1. Select `Install Extension`
223-
1. Choose the extension '`intellij-idea-keybindings`' *or* run `ext install intellijkeybind`
223+
1. Select `Extensions: Install Extension`
224+
1. Choose the extension '`intellij-idea-keybindings`'
224225
1. Reload Visual Studio Code
225226

226227

package.json

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intellij-idea-keybindings",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"publisher": "k--kato",
55
"engines": {
66
"vscode": "1.6.x"
@@ -52,7 +52,7 @@
5252
"key": "ctrl+space",
5353
"mac": "ctrl+space",
5454
"command": "editor.action.triggerSuggest",
55-
"when": "editorTextFocus",
55+
"when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly",
5656
"intellij": "Basic code completion (the name of any class, method or variable)"
5757
},
5858

@@ -75,7 +75,7 @@
7575
"key": "ctrl+p",
7676
"mac": "cmd+p",
7777
"command": "editor.action.triggerParameterHints",
78-
"when": "editorTextFocus",
78+
"when": "editorHasSignatureHelpProvider && editorTextFocus",
7979
"intellij": "Parameter info (within method call arguments)"
8080
},
8181

@@ -159,25 +159,25 @@
159159
"key": "ctrl+/",
160160
"mac": "cmd+/",
161161
"command": "editor.action.commentLine",
162-
"when": "editorTextFocus",
162+
"when": "editorTextFocus && !editorReadonly",
163163
"intellij": "Comment/uncomment with line comment"
164164
}, {
165165
"key": "ctrl+numpad_divide",
166166
"mac": "cmd+numpad_divide",
167167
"command": "editor.action.commentLine",
168-
"when": "editorTextFocus",
168+
"when": "editorTextFocus && !editorReadonly",
169169
"intellij": "Comment/uncomment with line comment"
170170
}, {
171171
"key": "ctrl+alt+/",
172172
"mac": "cmd+alt+/",
173173
"command": "editor.action.blockComment",
174-
"when": "editorTextFocus",
174+
"when": "editorTextFocus && !editorReadonly",
175175
"intellij": "Comment/uncomment with block comment"
176176
}, {
177177
"key": "ctrl+alt+numpad_divide",
178178
"mac": "cmd+alt+numpad_divide",
179179
"command": "editor.action.blockComment",
180-
"when": "editorTextFocus",
180+
"when": "editorTextFocus && !editorReadonly",
181181
"intellij": "Comment/uncomment with block comment"
182182
}, {
183183
"key": "ctrl+w",
@@ -206,7 +206,7 @@
206206
"key": "alt+enter",
207207
"mac": "alt+enter",
208208
"command": "editor.action.quickFix",
209-
"when": "editorTextFocus",
209+
"when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly",
210210
"intellij": "Show intention actions and quick-fixes"
211211
}, {
212212
"key": "ctrl+y",
@@ -217,9 +217,15 @@
217217
}, {
218218
"key": "ctrl+alt+l",
219219
"mac": "cmd+alt+l",
220-
"command": "editor.action.format",
221-
"when": "editorTextFocus",
220+
"command": "editor.action.formatDocument",
221+
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly",
222222
"intellij": "Reformat code"
223+
}, {
224+
"key": "ctrl+alt+l",
225+
"mac": "cmd+alt+l",
226+
"command": "editor.action.formatSelection",
227+
"when": "editorHasDocumentFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly",
228+
"intellij": "Reformat selected code"
223229
},
224230

225231

@@ -263,7 +269,7 @@
263269
"key": "ctrl+x",
264270
"mac": "cmd+x",
265271
"command": "editor.action.clipboardCutAction",
266-
"when": "editorTextFocus",
272+
"when": "editorTextFocus && !editorReadonly",
267273
"intellij": "Cut current line or selected block to clipboard"
268274
}, {
269275
"key": "ctrl+c",
@@ -275,7 +281,7 @@
275281
"key": "ctrl+v",
276282
"mac": "cmd+v",
277283
"command": "editor.action.clipboardPasteAction",
278-
"when": "editorTextFocus",
284+
"when": "editorTextFocus && !editorReadonly",
279285
"intellij": "Paste from clipboard"
280286
},
281287

@@ -292,13 +298,13 @@
292298
"key": "ctrl+d",
293299
"mac": "cmd+d",
294300
"command": "editor.action.copyLinesDownAction",
295-
"when": "editorTextFocus",
301+
"when": "editorTextFocus && !editorReadonly",
296302
"intellij": "Duplicate current line or selected block"
297303
}, {
298304
"key": "ctrl+backspace",
299305
"mac": "cmd+backspace",
300306
"command": "deleteAllRight",
301-
"when": "editorTextFocus",
307+
"when": "editorTextFocus && !editorReadonly",
302308
"intellij": "Delete line at caret"
303309
},
304310

@@ -315,13 +321,13 @@
315321
"key": "ctrl+enter",
316322
"mac": "cmd+enter",
317323
"command": "lineBreakInsert",
318-
"when": "editorTextFocus",
324+
"when": "editorTextFocus && !editorReadonly",
319325
"intellij": "Smart line split"
320326
}, {
321327
"key": "shift+enter",
322328
"mac": "shift+enter",
323329
"command": "editor.action.insertLineAfter",
324-
"when": "editorTextFocus",
330+
"when": "editorTextFocus && !editorReadonly",
325331
"intellij": "Start new line"
326332
},
327333

@@ -358,13 +364,13 @@
358364
"key": "ctrl+delete",
359365
"mac": "alt+delete",
360366
"command": "deleteWordLeft",
361-
"when": "editorTextFocus",
367+
"when": "editorTextFocus && !editorReadonly",
362368
"intellij": "Delete to word end"
363369
}, {
364370
"key": "ctrl+backspace",
365371
"mac": "alt+backspace",
366372
"command": "deleteWordRight",
367-
"when": "editorTextFocus",
373+
"when": "editorTextFocus && !editorReadonly",
368374
"intellij": "Delete to word start"
369375
},
370376

@@ -484,7 +490,7 @@
484490
"key": "alt+f7",
485491
"mac": "alt+f7",
486492
"command": "editor.action.referenceSearch.trigger",
487-
"when": "editorTextFocus",
493+
"when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor",
488494
"intellij": "Find usages"
489495
},
490496

@@ -754,7 +760,7 @@
754760
"key": "ctrl+b",
755761
"mac": "cmd+b",
756762
"command": "editor.action.goToDeclaration",
757-
"when": "editorTextFocus",
763+
"when": "editorHasDefinitionProvider && editorTextFocus",
758764
"intellij": "Go to declaration"
759765
},
760766

@@ -771,15 +777,8 @@
771777
"key": "ctrl+shift+i",
772778
"mac": "alt+space",
773779
"command": "editor.action.previewDeclaration",
774-
"when": "editorTextFocus",
780+
"when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor",
775781
"intellij": "Open quick definition lookup"
776-
}, {
777-
"key": "ctrl+shift+b",
778-
"mac": "ctrl+shift+b",
779-
"command": "editor.action.goToTypeDeclaration",
780-
"when": "editorTextFocus",
781-
"intellij": "Go to type declaration",
782-
"todo": "not working"
783782
},
784783

785784

@@ -899,14 +898,19 @@
899898

900899

901900

902-
903-
904-
905-
906-
907-
908-
909-
901+
{
902+
"key": "f4",
903+
"mac": "f4",
904+
"command": "editor.action.goToDeclaration",
905+
"when": "editorHasDefinitionProvider && editorTextFocus",
906+
"intellij": "Edit source"
907+
}, {
908+
"key": "ctrl+enter",
909+
"mac": "cmd+down",
910+
"command": "editor.action.goToDeclaration",
911+
"when": "editorHasDefinitionProvider && editorTextFocus",
912+
"intellij": "View source"
913+
},
910914

911915

912916

@@ -991,7 +995,7 @@
991995
"key": "shift+f6",
992996
"mac": "shift+f6",
993997
"command": "editor.action.rename",
994-
"when": "editorTextFocus",
998+
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly",
995999
"intellij": "Rename"
9961000
},
9971001

0 commit comments

Comments
 (0)