vscode 快捷鍵


[
    //-------------------------------------------------
    //查找
    //-------------------------------------------------
    //下一個查找結果
    { "key": "ctrl+=",          "command":"editor.action.moveSelectionToNextFindMatch","when":"editorFocus" },
    //上一個查找結果
    { "key": "ctrl+-",          "command": "editor.action.moveSelectionToPreviousFindMatch","when": "editorFocus" },

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

    //在當前文件中查找當前選中
    { "key": "ctrl+e",          "command": "actions.findWithSelection" },

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

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

    //-------------------------------------------------
    //窗口視圖
    //-------------------------------------------------
    //上一視圖
    { "key": "ctrl+alt+,",        "command": "workbench.action.navigateBack" },
    //下一視圖
    { "key": "ctrl+alt+.",       "command": "workbench.action.navigateForward" },

    //上一tab頁簽
    { "key": "ctrl+9",   "command": "workbench.action.nextEditor" },
    //下一tab頁簽
    { "key": "ctrl+0",     "command": "workbench.action.previousEditor" },

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

    //關閉當前tab頁簽
    { "key": "ctrl+w","command": "workbench.action.closeActiveEditor" },
    { "key": "ctrl+w","command": "workbench.action.closeWindow","when": "!editorIsOpen" },

    //將當前tab頁簽分割
    { "key": "ctrl+\\","command": "workbench.action.splitEditor" },
    { "key": "ctrl+shift+\\",             "command": "workbench.action.toggleEditorGroupLayout" },

    //放大縮小
    { "key": "alt+=",        "command": "workbench.action.zoomIn" },
    { "key": "alt+-",   "command": "workbench.action.zoomOut" },
    { "key": "alt+0",           "command": "workbench.action.zoomReset" },

    { "key": "alt+e",                   "command": "workbench.view.explorer" },
    { "key": "alt+b",                   "command": "workbench.action.toggleSidebarVisibility" },

    //-------------------------------------------------
    //行操作
    //-------------------------------------------------
    //本行下插入空白行
    {"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": "alt+z","command": "editor.action.toggleWordWrap" },

    //-------------------------------------------------
    //刪除詞
    //-------------------------------------------------
    { "key": "ctrl+backspace","command": "deleteWordLeft","when": "textInputFocus && !editorReadonly" },
    { "key": "ctrl+delete","command": "deleteWordRight","when": "textInputFocus && !editorReadonly" },

    //-------------------------------------------------
    //書簽
    //-------------------------------------------------
    {"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+o","command": "bookmarks.clear"},
    {"key": "ctrl+shift+alt+o","command": "bookmarks.clearFromAllFiles"},

    {"key": "ctrl+alt+i","command": "bookmarks.list"},
    {"key": "ctrl+shift+alt+i","command": "bookmarks.listFromAllFiles"},

    //-------------------------------------------------
    //文件操作
    //-------------------------------------------------
    //復制當前文件路徑
    { "key": "ctrl+k ctrl+p","command": "workbench.action.files.copyPathOfActiveFile" },

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

    //打開文件
    {"key": "ctrl+p","command": "workbench.action.quickOpen"},
    {"key": "ctrl+p","command": "workbench.action.quickOpenNavigateNextInFilePicker","when": "inFilesPicker && inQuickOpen"},

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

    //保存文件
    { "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+k ctrl+o","command": "workbench.action.files.showOpenedFileInNewWindow" },

    //-------------------------------------------------
    //注釋
    //-------------------------------------------------
    {"key": "ctrl+k ctrl+b","command": "editor.action.blockComment","when": "editorTextFocus && !editorReadonly"},
    {"key": "ctrl+k ctrl+l","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+y","command": "redo","when": "textInputFocus && !editorReadonly"},
    { "key": "ctrl+z","command": "undo","when": "textInputFocus && !editorReadonly"},

    //-------------------------------------------------
    //選擇
    //-------------------------------------------------
    //括號選擇
    { "key": "ctrl+]","command": "editor.action.selectToBracket","when": "textInputFocus" },
    
    //匹配選擇
    {"key": "ctrl+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": "ctrl+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" },

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

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

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

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

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

    { "key": "alt+pageDown",         "command": "scrollLineDown","when": "textInputFocus" },
    { "key": "alt+pageUp",           "command": "scrollLineUp","when": "textInputFocus" },

    //-------------------------------------------------
    //列編輯
    //-------------------------------------------------
    //alt +鼠標左鍵單擊
    //按住鼠標中鍵拖拽
    { "key": "ctrl+shift+alt+up","command": "editor.action.insertCursorAbove","when": "editorTextFocus" },
    { "key": "ctrl+shift+alt+down","command": "editor.action.insertCursorBelow","when": "editorTextFocus" },

    //-------------------------------------------------
    //折疊
    //-------------------------------------------------
    { "key": "alt+u","command": "editor.unfold","when": "editorTextFocus" },
    { "key": "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": "shift+tab","command": "outdent","when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus" },
    { "key": "tab","command": "tab","when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus" },
    
    //-------------------------------------------------
    //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+a","command": "workbench.action.terminal.selectAll","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+f","command": "workbench.action.terminal.focusFindWidget","when": "terminalFocus" },
    { "key": "ctrl+n","command": "workbench.action.terminal.findNext","when": "terminalFindWidgetFocused" },
    { "key": "ctrl+shift+n","command": "workbench.action.terminal.findPrevious","when": "terminalFindWidgetFocused" },
    { "key": "alt+backspace","command": "workbench.action.terminal.deleteWordLeft","when": "terminalFocus" },
    { "key": "alt+delete","command": "workbench.action.terminal.deleteWordRight","when": "terminalFocus" },
    { "key": "ctrl+1","command": "workbench.action.terminal.focusAtIndex1","when": "terminalFocus" },
    { "key": "ctrl+2","command": "workbench.action.terminal.focusAtIndex2","when": "terminalFocus" },
    { "key": "ctrl+3","command": "workbench.action.terminal.focusAtIndex3","when": "terminalFocus" },
    { "key": "ctrl+4","command": "workbench.action.terminal.focusAtIndex4","when": "terminalFocus" },
    { "key": "ctrl+5","command": "workbench.action.terminal.focusAtIndex5","when": "terminalFocus" },
    { "key": "ctrl+6","command": "workbench.action.terminal.focusAtIndex6","when": "terminalFocus" },
    { "key": "ctrl+7","command": "workbench.action.terminal.focusAtIndex7","when": "terminalFocus" },
    { "key": "ctrl+alt+m","command": "workbench.action.toggleMaximizedPanel","when": "terminalFocus"},
    
    //-------------------------------------------------
    //編程
    //-------------------------------------------------
    { "key": "ctrl+alt+v","command": "editor.action.revealDefinition","when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"},
    { "key": "ctrl+alt+c","command": "references-view.find","when": "editorHasReferenceProvider"},
    { "key": "ctrl+g","command": "workbench.action.gotoLine"}
]

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM