首页 > 其他分享 >自己电脑上的vscode vim配置

自己电脑上的vscode vim配置

时间:2022-10-18 06:55:05浏览次数:49  
标签:commands vscode 电脑 workbench vim command action before

setting.json

 // vscode 的vim配置
  "vim.easymotion": true,
  "vim.incsearch": true,
  "vim.leader": "<space>",
  "vim.useSystemClipboard": true,
  "vim.useCtrlKeys": true,
  "vim.hlsearch": true,
  "vim.highlightedyank.enable": true,
  "vim.foldfix": true,
  "vim.normalModeKeyBindings": [],
  "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"
      ]
    },
    // Move cursor between problems
    {
      "before": [
        "[",
        "d"
      ],
      "commands": [
        "editor.action.marker.prev"
      ]
    },
    {
      "before": [
        "]",
        "d"
      ],
      "commands": [
        "editor.action.marker.next"
      ]
    },
    // Code actions
    {
      "before": [
        "<leader>",
        "s",
        "a"
      ],
      "commands": [
        "editor.action.sourceAction"
      ]
    },
    // 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"
      ]
    },
    // Find References
    {
      "before": [
        "g",
        "r"
      ],
      "commands": [
        "editor.action.goToReferences"
      ]
    },
    // 新建文件夹,在编辑器的区域
    {
      "before": [
        "<Leader>",
        "n",
        "d"
      ],
      "commands": [
        "explorer.newFolder"
      ]
    },
    // 新建文件,新建文件的位置取决于,文件资源管理器所在的位置
    {
      "before": [
        "<Leader>",
        "n",
        "f"
      ],
      "commands": [
        "explorer.newFile"
      ]
    },
    // 打开文件资源管理器,光标会聚焦到文件资源管理器的窗口 
    {
      "before": [
        "<leader>",
        "p",
        "o"
      ],
      "commands": [
        "workbench.view.explorer"
      ]
    },
    // 也是打开文件资源管理器,但是光标会聚焦到已经打开的文件资源窗口
    {
      "before": [
        "<leader>",
        "p",
        "O"
      ],
      "commands": [
        "workbench.files.action.showActiveFileInExplorer"
      ]
    },
    {
      "before": [
        "<leader>",
        "r",
      ],
      "command": "extension.runScript",
    },
    // close current edit window
    {
      "before": [
        "<leader>",
        "w",
        "c"
      ],
      "command": [
        "workbench.action.closeWindow"
      ]
    },
    // quick open
    {
      "before": [
        "<leader>",
        "q",
        "o"
      ],
      "commands": [
        "workbench.action.quickOpen"
      ]
    },
    // find char in files
    {
      "before": [
        "<leader>",
        "f",
        "f"
      ],
      "commands": [
        "workbench.action.findInFiles"
      ]
    },
    // 进入到terminal
    {
      "before": [
        "<leader>",
        "t",
        "t"
      ],
      "commands": [
        "workbench.action.terminal.toggleTerminal"
      ]
    },
    // 新建一个terminal终端
    {
      "before": [
        "<leader>",
        "t",
        "n"
      ],
      "commands": [
        "workbench.action.terminal.new"
      ]
    },
    // 隐藏和打开terminal 
    {
      "before": [
        "<leader>",
        "t",
        "h"
      ],
      "commands": [
        "workbench.action.togglePanel"
      ]
    },
    {
      "before": [
        "<leader>",
        "h",
        "e"
      ],
      "commands": [
        "workbench.action.maximizeEditor"
      ]
    },
    // 上下左右的移动pandel
    {
      "before": [
        "<leader>",
        "h"
      ],
      "commands": [
        "workbench.action.navigateLeft"
      ]
    },
    {
      "before": [
        "<leader>",
        "j"
      ],
      "commands": [
        "workbench.action.navigateDown"
      ]
    },
    {
      "before": [
        "<leader>",
        "k"
      ],
      "commands": [
        "workbench.action.navigateUp"
      ]
    },
    {
      "before": [
        "<leader>",
        "l"
      ],
      "commands": [
        "workbench.action.navigateRight"
      ]
    },
    // 移动下一个编辑器标签
    {
      "before": [
        "J",
      ],
      "commands": [
        "workbench.action.nextEditor"
      ]
    },
    // 移动到上一个编辑器标签
    {
      "before": [
        "K",
      ],
      "commands": [
        "workbench.action.previousEditor"
      ]
    },
    // 使用code run 来运行所有的代码
    {
      "before": [
        "<space>",
        "r",
        "r",
      ],
      "commands": [
        // "extension.runScript"
        // "autojspro.run"
        "code-runner.run"
      ]
    },
  ],
  "vim.insertModeKeyBindings": [
    // 退出插入模式
    {
      "before": [
        "j",
        "k"
      ],
      "after": [
        "<Esc>"
      ]
    }
  ],
  "vim.visualModeKeyBindingsNonRecursive": [
    // 移动到非空字符的行首
    {
      "before": [
        "H"
      ],
      "after": [
        "^"
      ]
    },
    // 移动到非空字符的行尾
    {
      "before": [
        "L"
      ],
      "after": [
        "$"
      ]
    }
  ],
  "editor.tokenColorCustomizations": {
    "[One Dark Modern]": {}
  },
  "vim.digraphs": {},
  "vim.commandLineModeKeyBindings": [],

keybings.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"
  },
  // 使用code runner运行所有的代码
  {
    "key": "ctrl+r",
    "command": "code-runner.run"
  },
  // 将编辑区域最大化,也就是隐藏文件浏览器
  {
    "key": "ctrl+h",
    "command": "workbench.action.maximizeEditor"
  }
]

标签:commands,vscode,电脑,workbench,vim,command,action,before
From: https://www.cnblogs.com/zhuoss/p/16801289.html

相关文章

  • 我的GVIM配置文件
    以下是我自己的vim配置文件。个人建议,还是使用完整的命令比较好,这样有助于理解记忆,尤其对于初次接触的人来说更重要。"显示行号,取消显示行号为nonumber,诸多进行相反......
  • 电脑右边小键盘默认解锁
    1、按“WIN键+R键”组合快捷键,打开运行窗口,输入“regedit”回车,打开注册表管理器。2、在注册表管理器中,依次点击展开“HKEY_USERS\.DEFAULT\ControlPanel\Keyboard项。......
  • idea的vim配置
    "================================================================================================"=Extensions====================================="=====......
  • vscode的vim设置
    settings.json"vim.leader":"<space>","vim.useSystemClipboard":true,"vim.hlsearch":true,"vim.highlightedyank.enable":true,"vim.foldf......
  • 【电脑管家之小Q书桌】
    前言:生活之中处处有知识,前几天,自己电脑无意间弹出了广告,心想,难道是最近重装了系统,电脑管家防广告功能关闭了,于是就去看了电脑管家,一切设置好后,一个好奇心又引导了我,我想,看看......
  • 【电脑关机后,电源指示灯仍然亮着!】
    前言:之前电脑装完win8.1系统后,某天才发现电脑关机了,但电源灯还亮着!消耗了一晚上的电量,电脑已体力透支,开机都开不了了,之后,每次关机后,都得重新按下开机键才能成功的关机!前几......
  • VSCode 插件开发打包提示Cannot find name 'Blob'
    问题描述执行打包vscepackage提示错误原因分析未知解决方法打开错误源,将Blob改成any实现效果......
  • 如何把视频做成电脑壁纸?Dynamic Wallpaper导入视频壁纸的方法
    如何把视频做成电脑壁纸?在日常生活中我们常常会碰到一些好看的视频,想要将其设置为电脑动态壁纸,您可以使用DynamicWallpaper这个软件来设置,具体DynamicWallpaper导入视频......
  • 优秀 截图 软件 (电脑必备)
    简单说明只要用电脑,它就应该是必备软件。大猫录课时,非常频繁的借助了该软件,我极少这样形容一个软件,除非它对我帮助很大功能 演示1.开始截图(快捷键F1)如果觉得不合适,可......
  • 【学员分享】程序员效率神器,最常用VIM插件安装大全
    相信大家多次被推荐用vim作为编辑程序,知道vim编辑有很多优点,但是vim初始界面太原始了,安装了之后只能用来编辑,如果要运行就需要退出去运行,麻烦死了。回想用现成的IDE是多么的......