vscode 快捷键

[
    //-------------------------------------------------
    //查找
    //-------------------------------------------------
    { "key": "ctrl+=",          "command":"editor.action.moveSelectionToNextFindMatch","when":"editorFocus" },
    { "key": "ctrl+-",          "command": "editor.action.moveSelectionToPreviousFindMatch","when": "editorFocus" },

    //当前文件查找
    { "key": "ctrl+f",          "command": "actions.find"},

    //文件夹中查找
    { "key": "alt+f",           "command": "workbench.view.search"},
    { "key": "alt+f",           "command": "workbench.action.findInFiles","when": "!searchInputBoxFocus" },

    //-------------------------------------------------
    //窗口视图
    //-------------------------------------------------
    { "key": "ctrl+alt+,",      "command": "workbench.action.navigateBack" },
    { "key": "ctrl+alt+.",      "command": "workbench.action.navigateForward" },
    { "key": "alt+,",      "command": "workbench.action.navigateBack" },
    { "key": "alt+.",      "command": "workbench.action.navigateForward" },

    //tab
    { "key": "alt+e",           "command": "workbench.action.nextEditor" },
    { "key": "alt+w",           "command": "workbench.action.previousEditor" },

    //{ "key": "alt+t",           "command": "workbench.action.showAllEditors"},

    //default ctrl+tab
    { "key": "alt+t", "command": "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup", "when": "!activeEditorGroupEmpty"},

    //关闭当前tab页签
    { "key": "alt+q",           "command": "workbench.action.closeActiveEditor" },
    { "key": "alt+q",           "command": "workbench.action.closeWindow","when": "!editorIsOpen" },

    //切换全屏
    { "key": "ctrl+alt+F12",    "command": "workbench.action.toggleFullScreen" },

    //将当前tab页签分割
    { "key": "ctrl+alt+=",      "command": "workbench.action.splitEditorRight" },
    { "key": "ctrl+alt+-",      "command": "workbench.action.splitEditorDown" },

    { "key": "ctrl+alt+0",      "command": "workbench.action.focusRightGroup"},
    { "key": "ctrl+alt+8",      "command": "workbench.action.focusAboveGroup"},
    { "key": "ctrl+alt+7",      "command": "workbench.action.focusBelowGroup"},
    { "key": "ctrl+alt+9",      "command": "workbench.action.focusLeftGroup"},

    //放大缩小
    { "key": "alt+=",           "command": "editor.action.fontZoomIn"},
    { "key": "alt+-",           "command": "editor.action.fontZoomOut"},
    { "key": "alt+0",           "command": "editor.action.fontZoomReset"},
    { "key": "shift+alt+=",     "command": "workbench.action.zoomIn" },
    { "key": "shift+alt+-",     "command": "workbench.action.zoomOut" },
    { "key": "shift+alt+0",     "command": "workbench.action.zoomReset" },

    //-------------------------------------------------
    //编辑行
    //-------------------------------------------------
    //插入空白行
    {"key": "ctrl+enter",       "command": "editor.action.insertLineAfter","when": "editorTextFocus && !editorReadonly"},
    {"key": "ctrl+shift+enter", "command": "editor.action.insertLineBefore","when": "editorTextFocus && !editorReadonly"},

    //移动行
    { "key": "alt+down",        "command": "editor.action.moveLinesDownAction","when": "editorTextFocus && !editorReadonly" },
    { "key": "alt+up",          "command": "editor.action.moveLinesUpAction", "when": "editorTextFocus && !editorReadonly" },

    //复制行
    { "key": "shift+alt+down",  "command": "editor.action.copyLinesDownAction","when": "editorTextFocus && !editorReadonly" },
    { "key": "shift+alt+up",    "command": "editor.action.copyLinesUpAction","when": "editorTextFocus && !editorReadonly" },

    //合并行
    { "key": "ctrl+j",          "command": "editor.action.joinLines", "when": "editorTextFocus && !editorReadonly" },

    //删除行
    { "key": "ctrl+d",          "command": "editor.action.deleteLines", "when": "textInputFocus && !editorReadonly" },

    //是否折叠行
    { "key": "ctrl+alt+z",      "command": "editor.action.toggleWordWrap" },

    //-------------------------------------------------
    //文件操作
    //-------------------------------------------------
    //复制当前文件路径
    { "key": "alt+p",           "command": "workbench.action.files.copyPathOfActiveFile" },

    //创建新文件
    { "key": "ctrl+n",          "command": "workbench.action.files.newUntitledFile" },

    //打开文件
    {"key": "alt+d",            "command": "workbench.action.quickOpen"},
    {"key": "alt+d",            "command": "workbench.action.quickOpenNavigateNextInFilePicker","when": "inFilesPicker && inQuickOpen"},

    //打开文件所在位置
    { "key": "alt+r",           "command": "workbench.action.files.revealActiveFileInWindows" },


    //在新窗口打开当前文件
    { "key": "ctrl+k ctrl+o",   "command": "workbench.action.files.showOpenedFileInNewWindow" },

    //-------------------------------------------------
    //注释
    //-------------------------------------------------
    { "key": "ctrl+alt+/",      "command": "editor.action.commentLine","when": "editorTextFocus && !editorReadonly"},

    //-------------------------------------------------
    //基本
    //-------------------------------------------------
    { "key": "ctrl+c",          "command": "editor.action.clipboardCopyAction","when": "textInputFocus"},
    { "key": "ctrl+v",          "command": "editor.action.clipboardPasteAction","when": "textInputFocus && !editorReadonly"},
    { "key": "ctrl+x",          "command": "editor.action.clipboardCutAction","when": "textInputFocus && !editorReadonly"},
    { "key": "ctrl+a",          "command": "editor.action.selectAll"},
    { "key": "ctrl+shift+z",    "command": "redo","when": "textInputFocus && !editorReadonly"},
    { "key": "ctrl+z",          "command": "undo","when": "textInputFocus && !editorReadonly"},
    //保存文件
    { "key": "ctrl+s",          "command": "workbench.action.files.save" },
    { "key": "alt+ctrl+s",      "command": "workbench.action.files.saveAll" },
    { "key": "shift+ctrl+s",    "command": "workbench.action.files.saveAs" },

    //-------------------------------------------------
    //选择
    //-------------------------------------------------

    //括号选择
    { "key": "ctrl+shift+]", "command": "editor.action.selectToBracket","when": "textInputFocus" },

    //匹配选择
    {"key": "alt+shift+m",   "command": "editor.action.addSelectionToNextFindMatch","when": "editorFocus"},

    //字选择
    { "key": "shift+down",   "command": "list.expandSelectionDown","when": "listFocus && !inputFocus" },
    { "key": "shift+up",     "command": "list.expandSelectionUp","when": "listFocus && !inputFocus" },
    { "key": "shift+left",   "command": "cursorLeftSelect","when": "textInputFocus" },
    { "key": "shift+right",  "command": "cursorRightSelect","when": "textInputFocus" },

    //行选择扩展
    { "key": "alt+shift+i",  "command": "expandLineSelection","when": "textInputFocus"},
    //行选择
    { "key": "shift+home",   "command": "cursorHomeSelect","when": "textInputFocus" },
    { "key": "shift+end",    "command": "cursorEndSelect","when": "textInputFocus" },

    //词选择
    { "key": "alt+shift+right",  "command": "cursorWordEndRightSelect","when": "textInputFocus" },
    { "key": "alt+shift+left",   "command": "cursorWordStartLeftSelect","when": "textInputFocus" },

    //页选择
    { "key": "shift+pageDown",   "command": "cursorPageDownSelect","when": "textInputFocus" },
    { "key": "shift+pageUp",     "command": "cursorPageUpSelect","when": "textInputFocus" },

    //文件
    { "key": "shift+alt+end",    "command": "cursorBottomSelect", "when": "textInputFocus"},
    { "key": "shift+alt+home",   "command": "cursorTopSelect", "when": "textInputFocus"},

    //-------------------------------------------------
    //cursor
    //-------------------------------------------------
    { "key": "ctrl+u",     "command": "cursorUndo","when": "textInputFocus" },

    //词
    { "key": "alt+left",   "command": "cursorWordStartLeft","when": "textInputFocus" },
    { "key": "alt+right",  "command": "cursorWordEndRight", "when": "textInputFocus" },

    //括号
    { "key": "ctrl+]",     "command": "editor.action.jumpToBracket","when": "editorTextFocus"},

    //行
    { "key": "home",       "command": "cursorHome","when": "textInputFocus" },
    { "key": "end",        "command": "cursorEnd","when": "textInputFocus" },

    //文件
    { "key": "alt+home",   "command": "cursorTop","when": "textInputFocus" },
    { "key": "alt+end",    "command": "cursorBottom","when": "textInputFocus" },

    //screen
    { "key": "alt+pageDown",  "command": "-scrollPageDown", "when": "textInputFocus" },
    { "key": "alt+pageUp",    "command": "-scrollPageUp",   "when": "textInputFocus"},
    { "key": "alt+PageUp",    "command": "Viewport.CursorTop", "when": "textInputFocus" },
    { "key": "alt+j",         "command": "Viewport.CursorTop", "when": "textInputFocus" },
    { "key": "alt+PageDown",  "command": "Viewport.CursorBottom", "when": "textInputFocus"},
    { "key": "alt+k",         "command": "Viewport.CursorBottom", "when": "textInputFocus"},
    { "key": "alt+m",         "command": "Viewport.CursorCenter", "when": "textInputFocus"},

    //-------------------------------------------------
    //scroll
    //-------------------------------------------------
    // current line to High Low Middle
    { "key": "alt+z", "command": "-editor.action.toggleWordWrap"},
    { "key": "alt+z", "command": "Viewport.scrollCenter", "when": "editorTextFocus"},
    { "key": "alt+h", "command": "Viewport.scrollTop", "when": "editorTextFocus"},
    { "key": "alt+l", "command": "Viewport.scrollBottom", "when": "editorTextFocus"},

    //line
    { "key": "ctrl+e",     "command": "scrollLineDown","when": "textInputFocus" },
    { "key": "ctrl+y",     "command": "scrollLineUp","when": "textInputFocus" },

    //half page
    { "key": "ctrl+r",     "command": "editorScroll",   "args": { "to": "down", "by": "halfPage" },"when": "textInputFocus" },
    { "key": "ctrl+t",     "command": "editorScroll",   "args": { "to": "up", "by": "halfPage" },"when": "textInputFocus" },

    //页
    { "key": "pageDown",   "command": "cursorPageDown","when": "textInputFocus" },
    { "key": "pageUp",     "command": "cursorPageUp","when": "textInputFocus" },

    //-------------------------------------------------
    //列编辑
    //-------------------------------------------------
    //alt +鼠标左键单击
    //按住鼠标中键拖拽
    //alt + shift + leftMouseClick
    { "key": "ctrl+shift+alt+up",   "command": "editor.action.insertCursorAbove","when": "editorTextFocus" },
    { "key": "ctrl+shift+alt+down", "command": "editor.action.insertCursorBelow","when": "editorTextFocus" },

    //-------------------------------------------------
    //折叠
    //-------------------------------------------------
    { "key": "ctrl+alt+u",            "command": "editor.unfold","when": "editorTextFocus" },
    { "key": "ctrl+alt+shift+u",      "command": "editor.unfoldAll","when": "editorTextFocus" },
    { "key": "ctrl+alt+f",            "command": "editor.fold","when": "editorTextFocus" },
    { "key": "ctrl+alt+shift+f",      "command": "editor.foldAll", "when": "editorTextFocus" },

    //-------------------------------------------------
    //书签
    //-------------------------------------------------
    {"key": "ctrl+alt+k",      "command": "bookmarks.toggle","when": "editorTextFocus"},
    {"key": "ctrl+alt+l",      "command": "bookmarks.jumpToNext","when": "editorTextFocus"},
    {"key": "ctrl+alt+j",      "command": "bookmarks.jumpToPrevious","when": "editorTextFocus"},
    {"key": "ctrl+alt+i",      "command": "bookmarks.list"},
    {"key": "ctrl+shift+alt+i","command": "bookmarks.listFromAllFiles"},

    {"key": "ctrl+alt+o",      "command": "bookmarks.clear"},
    {"key": "ctrl+shift+alt+o","command": "bookmarks.clearFromAllFiles"},

    //-------------------------------------------------
    //大小写
    //-------------------------------------------------
    { "key": "ctrl+shift+l",    "command": "editor.action.transformToLowercase" },
    { "key": "ctrl+shift+u",    "command": "editor.action.transformToUppercase"},

    //-------------------------------------------------
    //缩进
    //-------------------------------------------------
    { "key": "shift+tab",   "command": "outdent","when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus" },
    { "key": "tab",         "command": "tab","when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus" },

    //-------------------------------------------------
    //编程
    //-------------------------------------------------
    { "key": "ctrl+alt+v",  "command": "editor.action.revealDefinition","when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"},
    { "key": "ctrl+alt+c",  "command": "references-view.find","when": "editorHasReferenceProvider"},
    { "key": "alt+v",       "command": "editor.action.revealDefinition","when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"},
    { "key": "alt+c",       "command": "references-view.find","when": "editorHasReferenceProvider"},
    { "key": "ctrl+alt+b",  "command": "gitlens.toggleFileBlame","when": "editorTextFocus"},
    { "key": "ctrl+alt+n",  "command": "gitlens.toggleLineBlame"},
    { "key": "ctrl+alt+m",  "command": "editor.action.toggleMinimap","when": "editorTextFocus"},
    { "key": "ctrl+g",      "command": "workbench.action.gotoLine"},


    //-------------------------------------------------
    //mode switch
    //-------------------------------------------------
    { "key": "ctrl+1", "command": "workbench.action.focusFirstEditorGroup" },
    { "key": "ctrl+`", "command": "workbench.action.terminal.toggleTerminal", "when": "terminal.active"},

    //-------------------------------------------------
    //terminal
    //-------------------------------------------------

    { "key": "ctrl+shift+c", "command": "workbench.action.terminal.copySelection","when": "terminalFocus && terminalTextSelected" },
    { "key": "ctrl+shift+v", "command": "workbench.action.terminal.paste","when": "terminalFocus" },

    { "key": "ctrl+l",       "command": "workbench.action.terminal.clear","when": "terminalFocus" },
    { "key": "ctrl+\\",      "command": "workbench.action.terminal.split","when": "terminalFocus" },
    { "key": "end",          "command": "workbench.action.terminal.moveToLineEnd","when": "terminalFocus" },
    { "key": "home",         "command": "workbench.action.terminal.moveToLineStart","when": "terminalFocus" },
    //alt + left or right move by word
    { "key": "ctrl+alt+m",   "command": "workbench.action.toggleMaximizedPanel","when": "terminalFocus"},

    //remove
    { "key": "alt+b","command": "-extension.openInDefaultBrowser"},
    { "key": "alt+b","command": "-gitlens.toggleFileBlame","when": "editorTextFocus && config.gitlens.keymap == 'alternate' && gitlens:activeFileStatus =~ /blameable/" },
    { "key": "ctrl+alt+c","command": "-extension.convertSelection","when": "editorTextFocus"},
    { "key": "ctrl+alt+c", "command": "-l13Diff.action.panel.compareAll", "when": "l13DiffFocus && !inputFocus && !l13DiffInputFocus && !l13DiffSearchFocus"},
    { "key": "ctrl+e", "command": "-workbench.action.quickOpen"},
]

posted @ 2019-03-21 23:04  fndefbwefsowpvqfx  阅读(864)  评论(0编辑  收藏  举报