vscode配置 & item2配置

vscode

配置参考

按下 cmd+shift+p, 搜索setting.json和keybindings.json,参考这个仓库的配置

github.com/Melkeydev/v...

我的配置

setting.json

json 复制代码
{
  "workbench.colorTheme": "Default High Contrast",
  "editor.fontSize": 22,
  "terminal.integrated.fontSize": 24,
  "editor.codeLensFontSize": 5,
  "markdown.preview.fontSize": 24,
  "chat.editor.fontSize": 24,
  "notebook.markup.fontSize": 24,
  "notebook.output.fontSize": 24,
  "scm.inputFontSize": 24,
  "code-runner.runInTerminal": true,
  "workbench.iconTheme": "material-icon-theme",
  "explorer.confirmDelete": false,
  "editor.lineNumbers": "relative",

  //关于vim的配置文件,参考:https://zhuanlan.zhihu.com/p/188499395
  "vim.commandLineModeKeyBindingsNonRecursive": [],
  "vim.insertModeKeyBindings": [],
  // 定义空格键为我的前置键
  "vim.leader": "<space>",
  "vim.vimrc.enable": true,
  "vim.handleKeys": {
    "<C-a>": false,
    "<C-f>": false,
    "<C-n>": false,
    "<C-c>": false
  },
  "vim.hlsearch": true,
  "vim.normalModeKeyBindingsNonRecursive": [
    // NAVIGATION
    // switch b/w buffers
    { "before": ["<S-h>"], "commands": [":bprevious"] },
    { "before": ["<S-l>"], "commands": [":bnext"] },

    // splits
    { "before": ["leader", "v"], "commands": [":vsplit"] },
    { "before": ["leader", "s"], "commands": [":split"] },

    // NICE TO HAVE
    { "before": ["leader", "w"], "commands": [":w!"] },
    { "before": ["leader", "q"], "commands": [":q!"] },
    { "before": ["leader", "x"], "commands": [":x!"] },
    {
      "before": ["[", "d"],
      "commands": ["editor.action.marker.prev"]
    },
    {
      "before": ["]", "d"],
      "commands": ["editor.action.marker.next"]
    },
    {
      "before": ["<leader>", "c", "a"],
      "commands": ["editor.action.quickFix"]
    },
    { "before": ["leader", "f"], "commands": ["workbench.action.quickOpen"] },
    { "before": ["leader", "p"], "commands": ["editor.action.formatDocument"] },
    {
      "before": ["g", "h"],
      "commands": ["editor.action.showDefinitionPreviewHover"]
    }
  ],
  "vim.visualModeKeyBindings": [
    // Stay in visual mode while indenting
    { "before": ["<"], "commands": ["editor.action.outdentLines"] },
    { "before": [">"], "commands": ["editor.action.indentLines"] },
    // Move selected lines while staying in visual mode
    { "before": ["J"], "commands": ["editor.action.moveLinesDownAction"] },
    { "before": ["K"], "commands": ["editor.action.moveLinesUpAction"] },
    // toggle comment selection
    { "before": ["leader", "c"], "commands": ["editor.action.commentLine"] }
  ],

  "editor.formatOnSave": true,
  "[solidity]": {
    "editor.defaultFormatter": "NomicFoundation.hardhat-solidity"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },


  // go config
  "go.formatTool": "gofmt",
  "go.useLanguageServer": true,
  // go配置,强行指定goroot目录,不然每次打开文件都有报错:https://github.com/golang/vscode-go/issues/971
  "go.goroot": "/opt/homebrew/opt/go@1.22/libexec",
  "go.testExplorer.showDynamicSubtestsInEditor": true,
  "go.inferGopath": true,
  /*
  "go.autocompleteUnimportedPackages": true,
  "go.gocodePackageLookupMode": "go",
  "go.gotoSymbol.includeImports": true,
  "go.useCodeSnippetsOnFunctionSuggest": true,
  "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
  */
  "git.openRepositoryInParentFolders": "always",
  "terminal.integrated.defaultProfile.osx": "zsh",
  "redhat.telemetry.enabled": true,

  // java设置编译版本
  // 并在有多个版本的情况下,可以通过 settings.json 配置文件,设置 java.home 属性来指定所需的 JDK 路径。
  "java.jdt.ls.java.home": "/opt/homebrew/Cellar/openjdk@17/17.0.12/libexec/openjdk.jdk/Contents/Home",
  "java.configuration.runtimes": [
    {
      "name": "JavaSE-17",
      "path": "/opt/homebrew/Cellar/openjdk@17/17.0.12/libexec/openjdk.jdk/Contents/Home",
      "default": true
    }
  ],
  "explorer.confirmDragAndDrop": false,
  "solidity.telemetry": true,
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "diffEditor.ignoreTrimWhitespace": false,
  "diffEditor.hideUnchangedRegions.enabled": true,
  "explorer.confirmPasteNative": false,
  "makefile.configureOnOpen": false,
  "breadcrumbs.enabled": false,
  "gitlens.graph.minimap.enabled": false,
  "http.electronFetch": true,
  "gitlens.terminalLinks.showDetailsView": false,
  "gitlens.terminal.overrideGitEditor": false
}

keybindings.json

json 复制代码
// Place your key bindings in this file to override the defaults
[
    // NAVIGATION
    {
      "key": "ctrl+shift+j",
      "command": "workbench.action.terminal.focusNext",
      "when": "terminalFocus"
    },
    {
      "key": "ctrl+shift+k",
      "command": "workbench.action.terminal.focusPrevious",
      "when": "terminalFocus"
    },
    {
      "key": "ctrl+shift+n",
      "command": "workbench.action.terminal.new",
      "when": "terminalFocus"
    },
    {
      "key": "ctrl+shift+w",
      "command": "workbench.action.terminal.kill",
      "when": "terminalFocus"
    },
    // FILE TREE
    {
      "command": "workbench.action.toggleSidebarVisibility",
      "key": "ctrl+e"
    },
    {
      "command": "workbench.files.action.focusFilesExplorer",
      "key": "ctrl+e",
      "when": "editorTextFocus"
    },
    {
      "key": "n",
      "command": "explorer.newFile",
      "when": "filesExplorerFocus && !inputFocus"
    },
    {
      "command": "renameFile",
      "key": "r",
      "when": "filesExplorerFocus && !inputFocus"
    },
    {
      "key": "shift+n",
      "command": "explorer.newFolder",
      "when": "explorerViewletFocus"
    },
    {
      "command": "deleteFile",
      "key": "d",
      "when": "filesExplorerFocus && !inputFocus"
    },
  
    // EXTRA
    {
      "key": "ctrl+shift+5",
      "command": "editor.emmet.action.matchTag"
    },
    {
      "key": "ctrl+z",
      "command": "workbench.action.toggleZenMode"
    }
  ]

重点快捷键

  • cmd + j: 弹出终端(下方的终端)
  • ctrl + e:弹出文件目录(vscode左侧的explorer)
  • n:新建文件(当光标在explorer的时候)
  • N:新建文件夹(当光标在explorer的时候)
  • r: 重命名文件(当光标在explorer的时候)
  • d:删除文件(当光标在explorer的时候)
  • space + v : 分屏
  • space + h :光标移到左边分屏group
  • space + l :光标移到右边分屏group

终端item2

复制的问题

如果用鼠标进行复制,会失败,会有warning.

  1. 打开 iTerm2 设置 (Cmd + ,)。

  2. 进入 Profiles -> Terminal

  3. 确保 Mouse Reporting 被禁用。

但是如果禁用的话,就会无法用鼠标来上下滚动终端了,所以既想用鼠标,又想复制终端内容的话,就按下 +y 来复制

相关推荐
尘中客1 小时前
放弃 Echarts?前端直接渲染后端高精度 SVG 矢量图流的踩坑记录
前端·javascript·echarts·前端开发·svg矢量图·echarts避坑
FreeBuf_2 小时前
Chrome 0Day漏洞遭野外利用
前端·chrome
小彭努力中2 小时前
199.Vue3 + OpenLayers 实现:点击 / 拖动地图播放音频
前端·vue.js·音视频·openlayers·animate
2501_916007472 小时前
网站爬虫原理,基于浏览器点击行为还原可接口请求
前端·javascript·爬虫·ios·小程序·uni-app·iphone
前端大波2 小时前
Sentry 每日错误巡检自动化:设计思路与上手实战
前端·自动化·sentry
ZC跨境爬虫3 小时前
使用Claude Code开发校园交友平台前端UI全记录(含架构、坑点、登录逻辑及算法)
前端·ui·架构
慧一居士3 小时前
Vue项目中,何时使用布局、子组件嵌套、插槽 对应的使用场景,和完整的使用示例
前端·vue.js
2401_895521343 小时前
SpringBoot Maven快速上手
spring boot·后端·maven
Можно3 小时前
uni.request 和 axios 的区别?前端请求库全面对比
前端·uni-app
disgare4 小时前
关于 spring 工程中添加 traceID 实践
java·后端·spring