VsCodeSetting

236 阅读1分钟

VsCode Vim配置

苦茶甜橙B站视频

主题安装(Everforest)

Material Icon Theme

Project Manager

  • setting.json
"projectManager.git.baseFolders": ["$home/workspace"],
"projectManager.sortList": "Recent",
  • keybinding.json
    {
        "key": "ctrl+o",
        "command": "projectManager.listGitProjects#sideBarGit"
    }

expand-region

   {
        "key": "ctrl+=",
        "command": "expand_region","when": "editorTextFocus"
    },
    {
        "key": "ctrl+-",
        "command": "undo_expand_region",
        "when": "editorTextFocus && editorHasSelection"
    }

Template String Converter

Turbo Console Log

  • keybingding.json
Turbo Console Log

安装字体

brew tap homebrew/cask-fonts
brew search caskaydia
brew install font-caskaydia-cove-font

去除minimap

进入禅模式

ctrl+shint+p Toggle Zen Mode
  {
        "key": "ctrl+w",
        "command": "expand_region",
        "when": "editorTextFocus"
  },
  {
        "key": "ctrl+shift+w",
        "command": "undo_expand_region",
        "when": "editorTextFocus && editorHasSelection"
  }

Sort JSON objects

  • setting.json
  "sortJSON.orderOverride": ["name", "version", "description"],
  "sortJSON.orderUnderride": ["dependencies", "devDependencies"] 

Code Action

  • setting.json
    "editor.codeActionsOnSave": {
        "source.addMissingImports": true,
        "source.organizeImports": true,
        "source.removeUnused": true
    }

Prettier

 "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
  "[typescirpt]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },  
    "[typescriptreact]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },

vim

  • 设置前缀
"vim.leader": "<space>"
  • 全选
 { 
            "before": ["<c-a>"],
            "after": ["g","g","V","G"]
 }
  • hover显示信息
  {
            "before": ["leader","k"],
            "commands": ["editor.action.showHover"]
  }

    "vim.leader": "<space>",
    "vim.normalModeKeyBindings": [
        {
            "before": ["leader","w"],
            "commands": [":w!"]
        },
        {
            "before": ["leader","q"],
            "commands": [":q!"]
        },
        {
            "before": ["leader","x"],
            "commands": [":x!"]
        },
        { 
            "before": ["<c-a>"],
            "after": ["g","g","V","G"]
        },
        {
            "before": ["leader","k"],
            "commands": ["editor.action.showHover"]
        },
        {
            "before": ["]","d"],
            "commands": ["edirot.action.mark.next"]
        },
        {
            "before": ["[","d"],
            "commands": ["editor.action.mark.prev"]
        },
        {
            "before": ["leader","c","a"],
            "commands": ["editor.action.quickFix"]
        },

Toggle Boolean

  • setting.json
        {
            "before": ["leader","i"],
            "commands": ["extension.toggleBool"],
        },

文件数的操作

  • keybingding.json
 {
        "command": "workbench.action.toggleSidebarVisibility",
        "key": "ctrl+e"
    },
    {
        "command": "workbench.files.action.focusFilesExplorer",
        "key": "ctrl+e",
        "when": "editorTextFocus"
    },
    {
        "command": "explorer.newFile",
        "key": "a",
        "when": "filesExplorerFocus "
    },
    {
        "command": "renameFile",
        "key": "r",
        "when": "filesExplorerFocus && !inputFocus"
    },
    {
        "command": "filesExplorer.copy",
        "key": "c",
        "when": "filesExplorerFocus && !inputFocus"
    },
    {
        "command": "filesExplorer.paste",
        "key": "p",
        "when": "filesExplorerFocus && !inputFocus"
    },
    {
        "command": "deleteFile",
        "key": "d",
        "when": "filesExplorerFocus && !inputFocus"
    }
   "editor.lineNumbers": "relative",
    "zenMode.hideLineNumbers": false,
    "editor.stickyScroll.enabled": true,
    "editor.linkedEditing": false,
    "editor.suggest.insertMode": "replace",
    "workbench.startupEditor": "readme",
    "typescript.preferences.importModuleSpecifier": "non-relative",
    "typescript.updateImportsOnFileMove.enabled": "always",
    "explorer.confirmDelete": false,
    "explorer.confirmDragAndDrop": true,
    "extensions.autoUpdate": "onlyEnabledExtensions",
    "extensions.ignoreRecommendations": true,