首页 > 其他分享 >vscode 的键盘配置

vscode 的键盘配置

时间:2023-02-01 22:33:56浏览次数:43  
标签:workbench vscode 配置 commands 键盘 editor action true before

setting.json

{
  //-------------------------------------------------
  // yapf
  // "python.formatting.provider": "yapf",
  "python.formatting.yapfArgs": ["--style", "{column_limit: 150}"],
  // autopep8
  "python.formatting.provider": "autopep8",
  "python.formatting.autopep8Args": ["--max-line-length=150"],
  // black
  // "python.formatting.provider": "black",
  "python.formatting.blackArgs": ["--line-length", "150"],
  //--------------------------------------------------
  "[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.formatOnSave": true,
  "editor.lineNumbers": "on",
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  // -------------------------------------------------
  "vim.leader": "<space>",
  "vim.useSystemClipboard": true,
  "vim.hlsearch": true,
  "vim.highlightedyank.enable": true,
  "vim.foldfix": true,
  "vim.easymotion": true,
  "vim.incsearch": true,
  "vim.useCtrlKeys": true,
  "vim.surround": true,
  "vim.sneak": true,
  "vim.sneakUseIgnorecaseAndSmartcase": true,
  "vim.normalModeKeyBindingsNonRecursive": [
    // Go to start or end of line---------------------------
    {
      "before": ["H"],
      "after": ["^"]
    },
    {
      "before": ["L"],
      "after": ["$"]
    },
    // ----------------------------------------------------
    // Jump to change
    {
      "before": ["[", "c"],
      "commands": ["workbench.action.editor.previousChange"]
    },
    {
      "before": ["]", "c"],
      "commands": ["workbench.action.editor.nextChange"]
    },
    // Code actions
    {
      "before": ["<leader>", "s", "a"],
      "commands": ["editor.action.sourceAction"]
    },
    {
      "before": ["<space>", "r", "r"],
      "commands": [
        // "extension.runScript"
        // "autojspro.run"
        "code-runner.run"
      ]
    },
    // Quick fix
    {
      "before": ["<leader>", "q", "f"],
      "commands": ["editor.action.quickFix"]
    },
    // 重用名变量
    {
      "before": ["<leader>", "r", "n"],
      "commands": ["editor.action.rename"]
    },
    // Format 格式化当前文件
    {
      "before": ["<leader>", "f", "m"],
      "commands": ["editor.action.formatDocument"]
    },
    // go===================================================
    // go to  References
    {
      "before": ["g", "r"],
      "commands": ["editor.action.goToReferences"]
    },
    // ===================================================
    // new===================================================
    // 新建文件夹,在编辑器的区域
    {
      "before": ["<Leader>", "n", "d"],
      "commands": ["explorer.newFolder"]
    },
    // 新建文件,新建文件的位置取决于,文件资源管理器所在的位置
    {
      "before": ["<Leader>", "n", "f"],
      "commands": ["explorer.newFile"]
    },
    // =====================================================
    // open========================================================
    // 打开文件资源管理器,光标会聚焦到文件资源管理器的窗口
    {
      "before": ["<leader>", "o", "e"],
      "commands": ["workbench.view.explorer"]
    },
    // open search bar
    {
      "before": ["<leader>", "o", "s"],
      "commands": ["workbench.action.quickOpen"]
    },
    // 进入到terminal
    {
      "before": ["<leader>", "o", "t"],
      "commands": ["workbench.action.terminal.toggleTerminal"]
    },
    // 新建一个terminal终端
    {
      "before": ["<leader>", "o", "T"],
      "commands": ["workbench.action.terminal.new"]
    },
    // 隐藏和打开terminal
    {
      "before": ["<leader>", "o", "t"],
      "commands": ["workbench.action.togglePanel"]
    },
    // ================================================
    // find char in all files(fing in all files)
    {
      "before": ["<leader>", "f", "a"],
      "commands": ["workbench.action.findInFiles"]
    },
    // ===============================================
    // 移动==============================================================================
    // 左右移动标签页------------------------------------------------
    {
      "before": ["<leader>", "h"],
      "commands": ["workbench.action.navigateLeft"]
    },
    {
      "before": ["<leader>", "l"],
      "commands": ["workbench.action.navigateRight"]
    },
    // 移动下一个编辑器标签
    {
      "before": ["J"],
      "commands": ["workbench.action.nextEditor"]
    },
    // 移动到上一个编辑器标签
    {
      "before": ["K"],
      "commands": ["workbench.action.previousEditor"]
    },
    // 左右移动标签页---------------------------------------------------------------
    {
      "before": ["<space>", "'"],
      "commands": ["workbench.action.maximizeEditor"]
    },
    // 保存当前文件---------------------------------------------------------------
    {
      "before": ["<space>", "s"],
      "commands": ["workbench.action.files.save"]
    },
    {
      "before": ["g", "b"],
      "commands": ["workbench.action.navigateBack"],
      "when": "canNavigateBack"
    },
    // workbench.action.closeActiveEditor
    {
      "before": ["<space>", "w", "c"],
      "commands": ["workbench.action.closeActiveEditor"]
    },
    //workbench.action.closeAllEditors
    {
      "before": ["<space>", "w", "a"],
      "commands": ["workbench.action.closeOtherEditors"]
    },

    {
      "before": ["<space>", "q", "f"],
      "commands": ["editor.action.quickFix"]
    }
  ],
  "vim.insertModeKeyBindings": [
    // 退出插入模式
    {
      "before": ["j", "k"],
      "after": ["<Esc>"]
    }
  ],
  "vim.visualModeKeyBindingsNonRecursive": [
    // 移动到非空字符的行首
    {
      "before": ["H"],
      "after": ["^"]
    },
    // 移动到非空字符的行尾
    {
      "before": ["L"],
      "after": ["$"]
    }
  ],
  "vim.digraphs": {},
  "vim.commandLineModeKeyBindings": [],
  "vim.commandLineModeKeyBindingsNonRecursive": [],
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  // ====================================================================
  "EnglishChineseDictionary.enableHover": true,
  "security.workspace.trust.untrustedFiles": "open",
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "liveServer.settings.donotShowInfoMsg": true,
  "typescript.updateImportsOnFileMove.enabled": "always",
  "javascript.updateImportsOnFileMove.enabled": "always",
  "[python]": {
    "editor.defaultFormatter": "ms-python.python"
  },
  "python.defaultInterpreterPath": "C:\\Program Files\\Python310\\python.exe",
  // 忽略排除的文件
  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/Thumbs.db": true,
    "**/__pycache__": true, // python 生产的cache文件
    "**/.idea": true
  },
  "editor.suggestSelection": "first",
  "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
  "workbench.iconTheme": "Monokai Pro Icons",
  "workbench.colorTheme": "Monokai"
}

keybindings.json

// Place your key bindings in this file to override the defaultsauto[]
[
  // 以前配置的上下左右移动按键
  {
    "key": "alt+j",
    "command": "cursorLeft",
    "when": "textInputFocus"
  },
  {
    "key": "alt+k",
    "command": "cursorDown",
    "when": "textInputFocus"
  },
  {
    "key": "alt+l",
    "command": "cursorRight",
    "when": "textInputFocus"
  },
  {
    "key": "alt+i",
    "command": "cursorUp",
    "when": "textInputFocus"
  },
  // 切换到文件浏览器,可以在任何位置
  {
    "key": "ctrl+;",
    "command": "workbench.view.explorer",
    "when": "viewContainer.workbench.view.explorer.enabled"
  },
  // 切换到代码编辑区,不论在任何位置
  {
    "key": "ctrl+'",
    "command": "workbench.action.focusFirstEditorGroup"
  },
  // 切换到terminal终端
  {
    "key": "ctrl+,",
    "command": "workbench.action.terminal.toggleTerminal",
    "when": "terminal.active"
  },
  // 打开一个新的terminal
  {
    "key": "ctrl+shift+,",
    "command": "workbench.action.terminal.new",
    "when": "terminalProcessSupported || terminalWebExtensionContributedProfile"
  },
  // 在文件夹资源管理器中新建一个文件
  {
    "key": "a",
    "command": "explorer.newFile",
    "when": "filesExplorerFocus && !inputFocus"
  },
  // 在文件资源管理器里面创建一个文件夹
  {
    "key": "shift+a",
    "command": "explorer.newFolder",
    "when": "filesExplorerFocus && !inputFocus"
  },
  // 在文件资源管理器里面重应名当前文件或文件夹
  {
    "key": "r",
    "command": "renameFile",
    "when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  // 在文件资源管理器中删除文件
  {
    "key": "d",
    "command": "deleteFile",
    "when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
  },
  // 放大editor区域
  {
    "key": "ctrl+m",
    "command": "workbench.action.maximizeEditor"
  },
  // 使用code runner运行代码
  {
    "key": "ctrl+r",
    "command": "code-runner.run"
  },
  {
    "key": "y",
    "command": "filesExplorer.copy",
    "when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
  },
  {
    "key": "p",
    "command": "filesExplorer.paste",
    "when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
  }
]


标签:workbench,vscode,配置,commands,键盘,editor,action,true,before
From: https://www.cnblogs.com/zhuoss/p/17084333.html

相关文章

  • vscode 配置 plantuml
    1、首先安装plantuml插件2、安装java开发环境如果是mac系统,直接执行brewinstalljava,然后按照下图执行下提示中的命令即可如果是windows系统,需要去官网下载......
  • Ubuntu & CentOS配置JAVA JDK环境
    Linux配置JavaJDK环境下载地址:​​https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html​​根据系统相应版本进行下载。安装配置解......
  • Nginx 动态 转发 配置
    根据url转发任何求情http求情http://localhost/proxy/http://baidu.com/会访问:http://baidu.comhttps求情http://localhost/proxy/https://baidu.com/会访问:http......
  • nginx agent 来自官方的nginx 配置管理&监控方案
    我以前介绍过使用git+api模式的nginx配置管理,同时还介绍过一个基于graylog的日志收集方案,nginxagent是nginx官方提供的nginx配置以及metrics监控解决方案包含的特......
  • VSCode 自定义代码片段
    Ctrl+Shift+P输入“代码片段:配置用户代码片段”:搜索你想要设置的语言代码片段,比如,我设置.vue文件的代码片段,选择vue.json:可以配置多个代码片段,一个片段通过一个pr......
  • apt-get 详解&&配置阿里源
    转自:https://www.jianshu.com/p/fb337765c2c2apt-get详解&&配置阿里源配置apt-get的下载源1、复制原文件备份sudocp/etc/apt/sources.list/etc/apt/sources.list.ba......
  • 接口测试|Fiddler抓包设置及证书配置
    Fiddler抓包设置及证书配置设置抓HTTPS的请求包基础配置:路径:启动Fiddler》Tools》Options》HTTPS注意:Option更改完配置需重启Fiddler才能生效选中"DecrptHTTPStraffic",......
  • 代码规范配置editorconfig
    root=true[*]#表示所有文件适用charset=utf-8#设置文件字符集为utf-8indent_style=space#缩进风格indent_size=2#缩进大小end_of_line=lf#控制......
  • WIN10 自带输入法如何开启软键盘
    在任务栏上鼠标右键,在弹出的菜单栏上选择“显示触摸键盘按钮(Y)” 点击后托盘区语言栏左边会多出一个软键盘小图标 点击该图标即可调出软键盘:......
  • jar包启动脚本, 以及外置配置文件application.yml
    想使用sh脚本来启动,停止,重启我们的jar服务,顺便还要外置配置文件方便修改示例server.sh如下,启动命令为shserver.shstart或restart或stop,修改其中的这几个参数即可:......