vs code 快捷键设置

Posted searchor

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vs code 快捷键设置相关的知识,希望对你有一定的参考价值。

[
    //查找
    { "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": "alt+l",           "command": "editor.action.transformToLowercase" },
    { "key": "alt+u",           "command": "editor.action.transformToUppercase"},
   
    //窗口视图

    { "key": "ctrl+alt+left",        "command": "workbench.action.navigateBack" },
    { "key": "ctrl+alt+right",       "command": "workbench.action.navigateForward" },

    { "key": "alt+e",           "command": "workbench.view.explorer" }, 
    { "key": "alt+b","command": "workbench.action.toggleSidebarVisibility" },
    
    { "key": "ctrl+pagedown",   "command": "workbench.action.nextEditor" },
    { "key": "ctrl+pageup",     "command": "workbench.action.previousEditor" },

    { "key": "ctrl+alt+m","command": "workbench.action.toggleFullScreen" },
    { "key": "ctrl+w","command": "workbench.action.closeActiveEditor" },
    { "key": "ctrl+w","command": "workbench.action.closeWindow","when": "!editorIsOpen" },
    { "key": "ctrl+\\","command": "workbench.action.splitEditor" },
    { "key": "ctrl+alt+\\",             "command": "workbench.action.toggleEditorGroupLayout" },

    { "key": "ctrl+numpad_add",        "command": "workbench.action.zoomIn" },
    { "key": "ctrl+numpad_subtract",   "command": "workbench.action.zoomOut" },
    { "key": "ctrl+numpad0",           "command": "workbench.action.zoomReset" },

    //其它命令
    {"key": "alt+g","command": "workbench.action.tasks.runTask","args": "gvedit"},

    //插入空白行
    {"key": "ctrl+shift+enter","command": "editor.action.insertLineBefore","when": "editorTextFocus && !editorReadonly"},
    {"key": "ctrl+enter","command": "editor.action.insertLineAfter","when": "editorTextFocus && !editorReadonly"},
    
    //book mark
    {"key": "ctrl+alt+l","command": "bookmarks.jumpToNext","when": "editorTextFocus"},
    {"key": "ctrl+alt+j","command": "bookmarks.jumpToPrevious","when": "editorTextFocus"},
    {"key": "ctrl+alt+k","command": "bookmarks.toggle","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+m","command": "workbench.action.editor.changeLanguageMode" },
    { "key": "ctrl+k ctrl+p","command": "workbench.action.files.copyPathOfActiveFile" },
    { "key": "ctrl+n","command": "workbench.action.files.newUntitledFile" },
    { "key": "ctrl+o","command": "workbench.action.files.openFileFolder" },
    { "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": "shift+ctrl+f","command": "workbench.action.findInFiles","when": "!searchInputBoxFocus"},
    {"key": "ctrl+p","command": "workbench.action.quickOpen"},
    {"key": "ctrl+p","command": "workbench.action.quickOpenNavigateNextInFilePicker","when": "inFilesPicker && inQuickOpen"},
    {"key": "ctrl+shift+p","command": "workbench.action.quickOpenNavigatePreviousInFilePicker","when": "inFilesPicker && inQuickOpen"},
    
    //terminal
    {"key": "ctrl+[","command": "workbench.action.terminal.focusPrevious"},
    {"key": "ctrl+]","command": "workbench.action.terminal.focusNext"},

    { "key": "ctrl+`", "command": "workbench.action.terminal.toggleTerminal" },
    { "key": "ctrl+shift+`","command": "workbench.action.terminal.new" },

    { "key": "end","command": "workbench.action.terminal.moveToLineEnd","when": "terminalFocus" },
    { "key": "home","command": "workbench.action.terminal.moveToLineStart","when": "terminalFocus" },

    {"key": "ctrl+m","command": "workbench.action.toggleMaximizedPanel"},

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

    { "key": "ctrl+k","command": "workbench.action.terminal.clear","when": "terminalFocus" },
    
    { "key": "alt+backspace","command": "workbench.action.terminal.deleteWordLeft","when": "terminalFocus" },
    { "key": "alt+delete","command": "workbench.action.terminal.deleteWordRight","when": "terminalFocus" },
    
    //注释
    {"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+i","command": "expandLineSelection","when": "textInputFocus"},

    { "key": "shift+down","command": "list.expandSelectionDown","when": "listFocus && !inputFocus" },
    { "key": "shift+up","command": "list.expandSelectionUp","when": "listFocus && !inputFocus" },

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

    { "key": "shift+home","command": "cursorHomeSelect","when": "textInputFocus" },
    { "key": "shift+end","command": "cursorEndSelect","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": "ctrl+u","command": "cursorUndo","when": "textInputFocus" },

    //删除词
    { "key": "alt+backspace","command": "deleteWordLeft","when": "textInputFocus && !editorReadonly" },
    { "key": "alt+backspace","command": "deleteWordLeft","when": "textInputFocus && !editorReadonly" },

    //列编辑
    //alt +鼠标左键单击
    { "key": "ctrl+shift+alt+up","command": "editor.action.insertCursorAbove","when": "editorTextFocus" },
    { "key": "ctrl+shift+alt+i","command": "editor.action.insertCursorAtEndOfEachLineSelected","when": "editorTextFocus" },
    { "key": "ctrl+shift+alt+down","command": "editor.action.insertCursorBelow","when": "editorTextFocus" },

    //移动行
    { "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+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+u","command": "editor.foldAll", "when": "editorTextFocus" }
]

 

以上是关于vs code 快捷键设置的主要内容,如果未能解决你的问题,请参考以下文章

VS Code配置markdown代码片段

VS code自定义用户代码片段snippet

VS Code 插件整理

VS code 设置使用快捷键打开浏览器运行当前代码

vs code设置快捷键模式为eclipse的快捷键

vs code初体验