added keymap to package.json
This commit is contained in:
Родитель
37fdbd45e2
Коммит
d39be081b0
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"sourceMap": true,
|
||||
"rootDir": "."
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
".vscode-test"
|
||||
]
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vscode-sublime-importer",
|
||||
"version": "1.0.1",
|
||||
"name": "sublime-keybindings",
|
||||
"version": "3.0.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -11,9 +11,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "7.0.55",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.55.tgz",
|
||||
"integrity": "sha512-diCxfWNT4g2UM9Y+BPgy4s3egcZ2qOXc0mXLauvbsBUq9SBKQfh0SmuEUEhJVFZt/p6UDsjg1s2EgfM6OSlp4g==",
|
||||
"version": "7.0.60",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.60.tgz",
|
||||
"integrity": "sha512-ZfCUDgCOPBDn0aAsyBOcNh1nLksuGp3LAL+8GULccZN2IkMBG2KfiwFIRrIuQkLKg1W1dIB9kQZ9MIF3IgAqlw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/relaxed-json": {
|
||||
|
@ -163,9 +163,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"aws4": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
|
||||
"integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=",
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz",
|
||||
"integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==",
|
||||
"dev": true
|
||||
},
|
||||
"balanced-match": {
|
||||
|
@ -310,9 +310,9 @@
|
|||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
|
||||
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ=="
|
||||
"version": "2.15.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
|
||||
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag=="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
|
@ -473,7 +473,7 @@
|
|||
},
|
||||
"event-stream": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
|
||||
"resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
|
||||
"integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -933,7 +933,7 @@
|
|||
"dev": true,
|
||||
"requires": {
|
||||
"aws-sign2": "0.6.0",
|
||||
"aws4": "1.6.0",
|
||||
"aws4": "1.7.0",
|
||||
"caseless": "0.11.0",
|
||||
"combined-stream": "1.0.6",
|
||||
"extend": "3.0.1",
|
||||
|
@ -1171,7 +1171,7 @@
|
|||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "1.1.3",
|
||||
"commander": "2.11.0",
|
||||
"commander": "2.15.1",
|
||||
"is-my-json-valid": "2.17.2",
|
||||
"pinkie-promise": "2.0.1"
|
||||
}
|
||||
|
@ -1740,6 +1740,12 @@
|
|||
"supports-color": "4.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
|
||||
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==",
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
|
||||
|
@ -2037,7 +2043,7 @@
|
|||
"integrity": "sha1-fI1KovCVcEzQIOMugJm8rhA/C9Q=",
|
||||
"requires": {
|
||||
"chalk": "1.1.3",
|
||||
"commander": "2.11.0"
|
||||
"commander": "2.15.1"
|
||||
}
|
||||
},
|
||||
"remove-trailing-separator": {
|
||||
|
@ -2071,7 +2077,7 @@
|
|||
"dev": true,
|
||||
"requires": {
|
||||
"aws-sign2": "0.7.0",
|
||||
"aws4": "1.6.0",
|
||||
"aws4": "1.7.0",
|
||||
"caseless": "0.12.0",
|
||||
"combined-stream": "1.0.6",
|
||||
"extend": "3.0.1",
|
||||
|
@ -2476,9 +2482,9 @@
|
|||
"optional": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "2.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.5.3.tgz",
|
||||
"integrity": "sha512-ptLSQs2S4QuS6/OD1eAKG+S5G8QQtrU5RT32JULdZQtM1L3WTi34Wsu48Yndzi8xsObRAB9RPt/KhA9wlpEF6w==",
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.1.tgz",
|
||||
"integrity": "sha512-Ao/f6d/4EPLq0YwzsQz8iXflezpTkQzqAyenTiw4kCUGr1uPiFLC3+fZ+gMZz6eeI/qdRUqvC+HxIJzUAzEFdg==",
|
||||
"dev": true
|
||||
},
|
||||
"unique-stream": {
|
||||
|
@ -2492,9 +2498,9 @@
|
|||
}
|
||||
},
|
||||
"url-parse": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.2.0.tgz",
|
||||
"integrity": "sha512-DT1XbYAfmQP65M/mE6OALxmXzZ/z1+e5zk2TcSKe/KiYbNGZxgtttzC0mR/sjopbpOXcbniq7eIKmocJnUWlEw==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.3.0.tgz",
|
||||
"integrity": "sha512-zPvPA3T7P6M+0iNsgX+iAcAz4GshKrowtQBHHc/28tVsBc8jK7VRCNX+2GEcoE6zDB6XqXhcyiUWPVZY6C70Cg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"querystringify": "1.0.0",
|
||||
|
@ -2626,7 +2632,7 @@
|
|||
"request": "2.85.0",
|
||||
"semver": "5.5.0",
|
||||
"source-map-support": "0.5.4",
|
||||
"url-parse": "1.2.0",
|
||||
"url-parse": "1.3.0",
|
||||
"vinyl-source-stream": "1.1.2"
|
||||
}
|
||||
},
|
||||
|
|
502
package.json
502
package.json
|
@ -30,6 +30,23 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/Microsoft/vscode-sublime-keybindings/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||
"test": "npm run compile && node ./node_modules/vscode/bin/test",
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "^7.0.43",
|
||||
"@types/relaxed-json": "^1.0.0",
|
||||
"typescript": "^2.0.3",
|
||||
"vscode": "^1.1.14"
|
||||
},
|
||||
"dependencies": {
|
||||
"relaxed-json": "^1.0.1"
|
||||
},
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
|
@ -67,22 +84,473 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||
"test": "npm run compile && node ./node_modules/vscode/bin/test",
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "^7.0.43",
|
||||
"@types/relaxed-json": "^1.0.0",
|
||||
"typescript": "^2.0.3",
|
||||
"vscode": "^1.1.14"
|
||||
},
|
||||
"dependencies": {
|
||||
"relaxed-json": "^1.0.1"
|
||||
}
|
||||
"keybindings": [
|
||||
{
|
||||
"mac": "ctrl+shift+cmd+f",
|
||||
"win": "shift+f11",
|
||||
"linux": "shift+f11",
|
||||
"key": "shift+f11",
|
||||
"command": "workbench.action.toggleZenMode"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+w",
|
||||
"win": "ctrl+w",
|
||||
"linux": "ctrl+w",
|
||||
"key": "ctrl+w",
|
||||
"command": "workbench.action.closeActiveEditor"
|
||||
},
|
||||
{
|
||||
"mac": "shift+cmd+[",
|
||||
"key": "ctrl+pageup",
|
||||
"command": "workbench.action.previousEditor"
|
||||
},
|
||||
{
|
||||
"mac": "shift+cmd+]",
|
||||
"key": "ctrl+pagedown",
|
||||
"command": "workbench.action.nextEditor"
|
||||
},
|
||||
{
|
||||
"mac": "alt+cmd+s",
|
||||
"key": "none",
|
||||
"command": "workbench.action.files.saveAll"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k cmd+b",
|
||||
"win": "ctrl+k ctrl+b",
|
||||
"linux": "ctrl+k ctrl+b",
|
||||
"key": "ctrl+k ctrl+b",
|
||||
"command": "workbench.action.toggleSidebarVisibility"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+alt+up",
|
||||
"key": "ctrl+up",
|
||||
"command": "scrollLineUp",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+alt+down",
|
||||
"key": "ctrl+down",
|
||||
"command": "scrollLineDown",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+t",
|
||||
"key": "ctrl+p",
|
||||
"command": "workbench.action.quickOpen"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+r",
|
||||
"win": "ctrl+r",
|
||||
"linux": "ctrl+r",
|
||||
"key": "ctrl+r",
|
||||
"command": "workbench.action.gotoSymbol"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+r",
|
||||
"win": "ctrl+;",
|
||||
"linux": "ctrl+;",
|
||||
"key": "ctrl+;",
|
||||
"command": "workbench.action.gotoSymbol"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+alt+down",
|
||||
"key": "f12",
|
||||
"command": "editor.action.goToDeclaration"
|
||||
},
|
||||
{
|
||||
"win": "alt+-",
|
||||
"linux": "alt+-",
|
||||
"key": "ctrl+-",
|
||||
"command": "workbench.action.navigateBack"
|
||||
},
|
||||
{
|
||||
"win": "alt+shift+-",
|
||||
"linux": "alt+shift+-",
|
||||
"key": "ctrl+shift+-",
|
||||
"command": "workbench.action.navigateForward"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+g",
|
||||
"win": "f3",
|
||||
"linux": "f3",
|
||||
"key": "f3",
|
||||
"command": "editor.action.nextMatchFindAction",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "f4",
|
||||
"win": "f4",
|
||||
"linux": "f4",
|
||||
"key": "f4",
|
||||
"command": "editor.action.nextMatchFindAction",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "shift+f4",
|
||||
"win": "shift+f4",
|
||||
"linux": "shift+f4",
|
||||
"key": "shift+f4",
|
||||
"command": "editor.action.previousMatchFindAction",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+cmd+up",
|
||||
"win": "ctrl+shift+up",
|
||||
"linux": "ctrl+shift+up",
|
||||
"key": "ctrl+shift+up",
|
||||
"command": "editor.action.moveLinesUpAction",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+cmd+down",
|
||||
"win": "ctrl+shift+down",
|
||||
"linux": "ctrl+shift+down",
|
||||
"key": "ctrl+shift+down",
|
||||
"command": "editor.action.moveLinesDownAction",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+alt+/",
|
||||
"win": "ctrl+shift+/",
|
||||
"linux": "ctrl+shift+/",
|
||||
"key": "ctrl+shift+/",
|
||||
"command": "editor.action.commentLine",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k cmd+up",
|
||||
"win": "ctrl+k ctrl+up",
|
||||
"linux": "ctrl+k ctrl+up",
|
||||
"key": "ctrl+k ctrl+up",
|
||||
"command": "workbench.action.splitEditor"
|
||||
},
|
||||
{
|
||||
"mac": "alt+cmd+2",
|
||||
"win": "alt+shift+2",
|
||||
"linux": "alt+shift+2",
|
||||
"key": "alt+shift+2",
|
||||
"command": "workbench.action.splitEditor"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k cmd+down",
|
||||
"win": "ctrl+k ctrl+down",
|
||||
"linux": "ctrl+k ctrl+down",
|
||||
"key": "ctrl+k ctrl+down",
|
||||
"command": "workbench.action.closeActiveEditor"
|
||||
},
|
||||
{
|
||||
"mac": "alt+cmd+[",
|
||||
"key": "ctr+shift+[",
|
||||
"command": "editor.fold",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+alt+]",
|
||||
"key": "ctrl+shift+]",
|
||||
"command": "editor.unfold",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k cmd+0",
|
||||
"win": "ctrl+k ctrl+0",
|
||||
"linux": "ctrl+k ctrl+0",
|
||||
"key": "ctrl+k ctrl+0",
|
||||
"command": "editor.unfoldAll",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "alt+f12",
|
||||
"key": "alt+f12",
|
||||
"command": "editor.action.showContextMenu",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+shift+d",
|
||||
"win": "ctrl+shift+d",
|
||||
"linux": "ctrl+shift+d",
|
||||
"key": "ctrl+shift+d",
|
||||
"command": "editor.action.copyLinesDownAction",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+l",
|
||||
"win": "ctrl+l",
|
||||
"linux": "ctrl+l",
|
||||
"key": "ctrl+l",
|
||||
"command": "expandLineSelection",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+d",
|
||||
"win": "ctrl+d",
|
||||
"linux": "ctrl+d",
|
||||
"key": "ctrl+d",
|
||||
"command": "editor.action.addSelectionToNextFindMatch",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+m",
|
||||
"win": "ctrl+m",
|
||||
"linux": "ctrl+m",
|
||||
"key": "ctrl+m",
|
||||
"command": "editor.action.jumpToBracket",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+alt+/",
|
||||
"win": "ctrl+shift+/",
|
||||
"linux": "ctrl+shift+/",
|
||||
"key": "ctrl+shift+/",
|
||||
"command": "editor.action.blockComment",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+alt+f",
|
||||
"win": "ctrl+h",
|
||||
"linux": "ctrl+h",
|
||||
"key": "ctrl+h",
|
||||
"command": "editor.action.startFindReplaceAction"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+shift+k",
|
||||
"win": "ctrl+shift+k",
|
||||
"linux": "ctrl+shift+k",
|
||||
"key": "ctrl+shift+k",
|
||||
"command": "editor.action.deleteLines",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+shift+up",
|
||||
"win": "alt+shift+up",
|
||||
"linux": "alt+shift+up",
|
||||
"key": "alt+shift+up",
|
||||
"command": "editor.action.insertCursorAbove",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+shift+down",
|
||||
"win": "alt+shift+down",
|
||||
"linux": "alt+shift+down",
|
||||
"key": "alt+shift+down",
|
||||
"command": "editor.action.insertCursorBelow",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+shift+pageup",
|
||||
"win": "alt+shift+pageup",
|
||||
"linux": "alt+shift+pageup",
|
||||
"key": "alt+shift+pageup",
|
||||
"command": "cursorColumnSelectPageUp",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+shift+pagedown",
|
||||
"win": "alt+shift+pagedown",
|
||||
"linux": "alt+shift+pagedown",
|
||||
"key": "alt+shift+pagedown",
|
||||
"command": "cursorColumnSelectPageDown",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+shift+l",
|
||||
"win": "ctrl+shift+l",
|
||||
"linux": "ctrl+shift+l",
|
||||
"key": "ctrl+shift+l",
|
||||
"command": "editor.action.insertCursorAtEndOfEachLineSelected",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+1",
|
||||
"win": "alt+1",
|
||||
"linux": "alt+1",
|
||||
"key": "alt+1",
|
||||
"command": "workbench.action.openEditorAtIndex1"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+2",
|
||||
"win": "alt+2",
|
||||
"linux": "alt+2",
|
||||
"key": "alt+2",
|
||||
"command": "workbench.action.openEditorAtIndex2"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+3",
|
||||
"win": "alt+3",
|
||||
"linux": "alt+3",
|
||||
"key": "alt+3",
|
||||
"command": "workbench.action.openEditorAtIndex3"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+4",
|
||||
"win": "alt+4",
|
||||
"linux": "alt+4",
|
||||
"key": "alt+4",
|
||||
"command": "workbench.action.openEditorAtIndex4"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+5",
|
||||
"win": "alt+5",
|
||||
"linux": "alt+5",
|
||||
"key": "alt+5",
|
||||
"command": "workbench.action.openEditorAtIndex5"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+6",
|
||||
"win": "alt+6",
|
||||
"linux": "alt+6",
|
||||
"key": "alt+6",
|
||||
"command": "workbench.action.openEditorAtIndex6"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+7",
|
||||
"win": "alt+7",
|
||||
"linux": "alt+7",
|
||||
"key": "alt+7",
|
||||
"command": "workbench.action.openEditorAtIndex7"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+8",
|
||||
"win": "alt+8",
|
||||
"linux": "alt+8",
|
||||
"key": "alt+8",
|
||||
"command": "workbench.action.openEditorAtIndex8"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+9",
|
||||
"win": "alt+9",
|
||||
"linux": "alt+9",
|
||||
"key": "alt+9",
|
||||
"command": "workbench.action.openEditorAtIndex9"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+ctrl+g",
|
||||
"win": "alt+f3",
|
||||
"linux": "alt+f3",
|
||||
"key": "alt+f3",
|
||||
"command": "editor.action.selectHighlights",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+shift+r",
|
||||
"win": "ctrl+shift+r",
|
||||
"linux": "ctrl+shift+r",
|
||||
"key": "ctrl+shift+r",
|
||||
"command": "workbench.action.showAllSymbols"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+alt+left",
|
||||
"win": "alt+left",
|
||||
"linux": "ctrl+alt+left",
|
||||
"key": "ctrl+alt+left",
|
||||
"command": "cursorWordStartLeft",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+alt+right",
|
||||
"win": "alt+right",
|
||||
"linux": "ctrl+alt+right",
|
||||
"key": "ctrl+alt+right",
|
||||
"command": "cursorWordEndRight",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+alt+shift+left",
|
||||
"win": "alt+shift+left",
|
||||
"linux": "ctrl+alt+shift+left",
|
||||
"key": "ctrl+alt+shift+left",
|
||||
"command": "cursorWordStartLeftSelect",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+alt+shift+right",
|
||||
"win": "alt+shift+right",
|
||||
"linux": "ctrl+alt+shift+right",
|
||||
"key": "ctrl+alt+shift+right",
|
||||
"command": "cursorWordEndRightSelect",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+j",
|
||||
"key": "ctrl+j",
|
||||
"command": "editor.action.joinLines",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k cmd+u",
|
||||
"key": "ctrl+k ctrl+u",
|
||||
"command": "editor.action.transformToUppercase",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k cmd+l",
|
||||
"key": "ctrl+k ctrl+l",
|
||||
"command": "editor.action.transformToLowercase",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k a",
|
||||
"key": "ctrl+k a",
|
||||
"command": "workbench.action.showErrorsWarnings"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k n",
|
||||
"key": "ctrl+k n",
|
||||
"command": "editor.action.marker.next",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k p",
|
||||
"key": "ctrl+k p",
|
||||
"command": "editor.action.marker.prev",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+1",
|
||||
"win": "ctrl+1",
|
||||
"linux": "ctrl+1",
|
||||
"key": "ctrl+1",
|
||||
"command": "workbench.action.focusFirstEditorGroup",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+2",
|
||||
"win": "ctrl+2",
|
||||
"linux": "ctrl+2",
|
||||
"key": "ctrl+2",
|
||||
"command": "workbench.action.focusSecondEditorGroup",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "ctrl+3",
|
||||
"win": "ctrl+3",
|
||||
"linux": "ctrl+3",
|
||||
"key": "ctrl+3",
|
||||
"command": "workbench.action.focusThirdEditorGroup",
|
||||
"when": "editorFocus"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+p",
|
||||
"win": "ctrl+p",
|
||||
"linux": "ctrl+p",
|
||||
"key": "ctrl+p",
|
||||
"command": "workbench.action.quickOpenPreviousEditor"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+k cmd+k",
|
||||
"win": "ctrl+k ctrl+k",
|
||||
"linux": "ctrl+k ctrl+k",
|
||||
"command": "deleteAllRight",
|
||||
"key": "ctrl+k ctrl+k",
|
||||
"when": "editorTextFocus && !editorReadonly"
|
||||
},
|
||||
{
|
||||
"mac": "cmd+shift+space",
|
||||
"win": "ctrl+shift+space",
|
||||
"linux": "ctrl+shift+space",
|
||||
"command": "editor.action.smartSelect.grow",
|
||||
"key": "ctrl+shift+space",
|
||||
"when": "editorTextFocus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -4,11 +4,13 @@ import { AnalyzedSettings, Mapper } from './mapper';
|
|||
import { ISetting, MappedSetting } from './settings';
|
||||
import * as sublimeFolderFinder from './sublimeFolderFinder';
|
||||
import * as path from 'path';
|
||||
import { start } from './extensionKeymap';
|
||||
|
||||
const mapper = new Mapper();
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||
context.subscriptions.push(vscode.commands.registerCommand('extension.importFromSublime', () => importSettingsFromSublime()));
|
||||
start();
|
||||
}
|
||||
|
||||
async function importSettingsFromSublime(): Promise<void> {
|
||||
|
@ -112,10 +114,8 @@ async function importSettings(settings: ISetting[]): Promise<void> {
|
|||
const incrementSize = 100.0 / settings.length;
|
||||
const config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration();
|
||||
await Promise.all(settings.map(async setting => {
|
||||
// workaround for https://github.com/Microsoft/vscode/issues/47730
|
||||
return config.update(setting.name, 'bug-workaround-47730', vscode.ConfigurationTarget.Global)
|
||||
.then(() => config.update(setting.name, setting.value, vscode.ConfigurationTarget.Global))
|
||||
.then(() => progress.report({ increment: incrementSize, message: setting.name }));
|
||||
return config.update(setting.name, setting.value, vscode.ConfigurationTarget.Global)
|
||||
.then(() => progress.report({ increment: incrementSize, message: setting.name }));
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { WorkspaceConfiguration } from 'vscode';
|
||||
|
||||
const showInformationMessage = vscode.window.showInformationMessage;
|
||||
const isGlobalConfigValue = true;
|
||||
|
||||
export function start(): void {
|
||||
const editorConfig = vscode.workspace.getConfiguration('editor');
|
||||
const updateSetting = new VersionThreeUpdateSetting();
|
||||
|
||||
if (!updateSetting.hasPrompted && isDefaultValueSet(editorConfig, versionThreeSettings)) {
|
||||
new View(updateSetting, editorConfig).showMessage();
|
||||
}
|
||||
}
|
||||
|
||||
class Setting {
|
||||
constructor(public name: string, public value: any) { }
|
||||
}
|
||||
|
||||
const versionThreeSettings = [
|
||||
new Setting('multiCursorModifier', 'ctrlCmd'),
|
||||
new Setting('snippetSuggestions', 'top'),
|
||||
new Setting('formatOnPaste', true),
|
||||
];
|
||||
|
||||
function updateSettings(editorConfig: WorkspaceConfiguration, settings: Setting[]): void {
|
||||
settings.forEach((setting) => {
|
||||
editorConfig.update(setting.name, setting.value, isGlobalConfigValue);
|
||||
});
|
||||
}
|
||||
|
||||
function isDefaultValueSet(editorConfig: WorkspaceConfiguration, settings: Setting[]): boolean {
|
||||
for (const setting of settings) {
|
||||
const info = editorConfig.inspect(setting.name);
|
||||
const defaultValue = info ? info.defaultValue : null;
|
||||
const globalValue = info ? info.globalValue : null;
|
||||
|
||||
if (globalValue === defaultValue || globalValue === undefined) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
class VersionThreeUpdateSetting {
|
||||
public readonly hasPrompted: boolean;
|
||||
private name: string;
|
||||
private config: WorkspaceConfiguration;
|
||||
constructor() {
|
||||
this.name = 'promptV3Features';
|
||||
this.config = vscode.workspace.getConfiguration('sublimeTextKeymap');
|
||||
this.hasPrompted = this.config.get(this.name) || false;
|
||||
}
|
||||
|
||||
public async persist(): Promise<void> {
|
||||
return this.config.update(this.name, true, isGlobalConfigValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class View {
|
||||
private messages: { [key: string]: string } = {
|
||||
yes: 'Yes',
|
||||
no: 'No',
|
||||
learnMore: 'Learn More',
|
||||
prompt: 'New features are available for Sublime Text Keymap 3.0. Do you want to enable the new features?',
|
||||
noChange: 'Sublime Text Keymap: New features have not been enable.',
|
||||
change: 'Sublime Text Keymap: New features have been added.',
|
||||
};
|
||||
constructor(private updateSetting: VersionThreeUpdateSetting, private editorConfig: WorkspaceConfiguration) { }
|
||||
|
||||
public showMessage(): void {
|
||||
const answer = showInformationMessage(this.messages.prompt, this.messages.yes, this.messages.no, this.messages.learnMore);
|
||||
|
||||
answer.then((selectedOption) => {
|
||||
|
||||
if (selectedOption === this.messages.yes) {
|
||||
this.updateSetting.persist();
|
||||
updateSettings(this.editorConfig, versionThreeSettings);
|
||||
showInformationMessage(this.messages.change);
|
||||
} else if (selectedOption === this.messages.no) {
|
||||
this.updateSetting.persist();
|
||||
showInformationMessage(this.messages.noChange);
|
||||
} else if (selectedOption === this.messages.learnMore) {
|
||||
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@ import * as assert from 'assert';
|
|||
import { AnalyzedSettings, Mapper } from '../mapper';
|
||||
import { ISetting, MappedSetting } from '../settings';
|
||||
import * as testData from './testData';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
suite('Importer Tests', async () => {
|
||||
|
||||
|
@ -54,23 +53,4 @@ suite('Importer Tests', async () => {
|
|||
assert.ok(settings.alreadyExisting.length === 1);
|
||||
assert.ok(settings.noMappings.length === 1);
|
||||
});
|
||||
|
||||
test('Workaround for https://github.com/Microsoft/vscode/issues/47730', async () => {
|
||||
let config = vscode.workspace.getConfiguration();
|
||||
const settingName = 'editor.matchBrackets';
|
||||
const backupSettingValue = config.inspect(settingName)!.globalValue;
|
||||
await config.update(settingName, 'bogusValueForActivatingChangeListener', vscode.ConfigurationTarget.Global);
|
||||
await config.update(settingName, true, vscode.ConfigurationTarget.Global);
|
||||
config = vscode.workspace.getConfiguration();
|
||||
|
||||
const info = config.inspect(settingName);
|
||||
if (!info) {
|
||||
return assert.fail(info, 'inspect object');
|
||||
}
|
||||
|
||||
assert.ok(info.globalValue === true, `globalValue: ${info.globalValue} is not true`);
|
||||
assert.ok(info.defaultValue === true, `defaultValue: ${info.defaultValue} is not true`);
|
||||
|
||||
await config.update(settingName, backupSettingValue, vscode.ConfigurationTarget.Global);
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче