我的vscode配置

why vscode

曾经我还是懵懂的少年时,感觉IDEA世界第一(现在应该也是)php是世界上最好的语言。我曾经使用过IDEA WebStorm Subline Atom, 最后还是停留在了vscode。别问我为什么,就如同李忠盛的鬼迷心窍:有人问我你究竟是哪里好 这么多年我还忘不了 春风再美也比不上你的笑 没见过你的人不会明了,说了那么多一方面是因为no money,一方面是确实感觉vs code + vim适合自己。虽然最近fleet出了预览版,但我目前使用下来看的话,还是打不过vs code的。

配置

外观配置

  • vscode-icons

文件图标

  • Noctis

vs code主题

前端

前端我主要从事vue开发,目前在看一些react,虽然vs code自带了一些html特性,但要用起来顺手,还是需要一些额外的插件来实现的,我的vs配置文件会在文末附上

  • Atuo Rename Tag Auto Close Tag Bracket Pair Colorizer 2

自动重命名,自动闭合,括号匹配这些插件已经成为了vs code的内置特性,不必再安装,目前我的vs版本是1.72.2

  • Atuo Import Path Intellisense

自动引入,会自动查找文件路径并添加import语句,这个功能吧,感觉有时候不错,但它是按照相对路径引入,要写绝对路径的话,需要自己更改。路径只能提示。

  • Better Comments

注释强调,我主要用来高亮显示 TODO,有时候自己会忘掉一些空函数

  • JavaSript(ES6) code snippets

es6提示

  • CSS Peek DotENV EditorConfig for VS Code EsLint Prettier Sass SCSS Formatter

代码格式化,.env文件识别,sass提示等等

  • Git Graph GitLens - Git supercharged

git辅助

  • Vue Language Feature(Volar) Vue VSCode Snippets TypeScript Vue Plugin(Volar)

Vue3开发辅助插件

  • Translate Variable VSCode Neovim

中英文翻译,变量起名难的时候可以中文变英文;neovim,我自己比较喜欢使用vim按键绑定,所以基本上使用编辑器都会查看有没有vim查看,‘Neovim’ 和 vim插件差不多,但是Neovim可以使用neovim的配置文件.

最后,附上我的vs code配置文件

  • settings.json
{
    "workbench.startupEditor": "newUntitledFile",
    // "editor.formatOnType": true,
    // "editor.formatOnSave": true,
    // "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "editor.accessibilityPageSize": 18,
    "editor.fontSize": 16,
    "sync.gist": "bf12b62d5049f783784084522e7dbd69",
    "terminal.external.windowsExec": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\",
    "editor.letterSpacing": 1,
    "editor.lineHeight": 30,
    "terminal.integrated.rendererType": "dom",
    "workbench.activityBar.visible": true,
    "workbench.iconTheme": "vscode-icons",
    "editor.renderControlCharacters": false,
    "go.formatTool": "goimports",
    "files.autoSaveDelay": 10000,
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "editor.fontFamily": "'Cartograph Mono CF','Cascadia Code',Consolas, 'MesloLGS NF','Courier New', monospace",
    "editor.fontLigatures": true,
    "editor.codeActionsOnSave": {},
    "editor.fontWeight": "500",
    "workbench.preferredDarkColorTheme": "Noctis Sereno",
    "workbench.preferredHighContrastColorTheme": "Noctis Sereno",
    "workbench.preferredLightColorTheme": "Noctis Sereno",
    "terminal.integrated.fontSize": 16,
    "terminal.integrated.fontWeight": "500",
    "[dart]": {
        "editor.formatOnSave": true,
        "editor.formatOnType": true,
        "editor.rulers": [
            80
        ],
        "editor.selectionHighlight": false,
        "editor.suggest.snippetsPreventQuickSuggestions": false,
        "editor.suggestSelection": "first",
        "editor.tabCompletion": "onlySnippets",
        "editor.wordBasedSuggestions": false
    },
    "terminal.explorerKind": "external",
    "terminal.external.osxExec": "iTerm.app",
    "[html]": {
        "editor.defaultFormatter": "vscode.html-language-features"
    },
    "editor.renderWhitespace": "none",
    "[vue]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "leetcode.endpoint": "leetcode-cn",
    "leetcode.workspaceFolder": "/Users/crackzj/.leetcode",
    "vsicons.dontShowNewVersionMessage": true,
    "javascript.updateImportsOnFileMove.enabled": "never",
    "dart.previewLsp": true,
    "html.format.contentUnformatted": "",
    // "vetur.format.options.useTabs": true,
    //vim
    "vim.easymotion": true,
    "vim.incsearch": true,
    "vim.useSystemClipboard": true,
    "vim.useCtrlKeys": false,
    "vim.hlsearch": true,
    "vim.statusBarColors.normal": ["#8FBCBB", "#434C5E"],
    "vim.statusBarColors.insert": "#BF616A",
    "vim.statusBarColors.visual": "#B48EAD",
    "vim.statusBarColors.visualline": "#B48EAD",
    "vim.statusBarColors.visualblock": "#A3BE8C",
    "vim.statusBarColors.replace": "#D08770",
    "vim.statusBarColors.commandlineinprogress": "#007ACC",
    "vim.statusBarColors.searchinprogressmode": "#007ACC",
    "vim.statusBarColors.easymotionmode": "#007ACC",
    "vim.statusBarColors.easymotioninputmode": "#007ACC",
    "vim.statusBarColors.surroundinputmode": "#007ACC",
    "vim.insertModeKeyBindings": [
        {
        "before": ["j", "j"],
        "after": [""]
        }
    ],
    "vim.normalModeKeyBindingsNonRecursive": [
        {
        "before": ["", "d"],
        "after": ["d", "d"]
        },
        {
        "before": [""],
        "commands": [":nohl"]
        }
    ],
    "vim.leader": "",
    "vim.handleKeys": {
        
    
        "": false,
        "": false
    },
    "[typescript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "workbench.editor.untitled.hint": "hidden",
    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "go.toolsManagement.autoUpdate": true,
    "vim.normalModeKeyBindings": [
        {
            "before": ["£"],
            "after": ["#"]
        },
        // {
        //     "before": [":"],
        //     "commands": [
        //         "workbench.action.showCommands",
        //     ]
        // },
        {
            "before": ["", "m"],
            "commands": [
                "bookmarks.toggle"
            ]
        },
        {
            "before": ["", "b"],
            "commands": [
                "bookmarks.list"
            ]
        },
        {
            "before":[""],
            "commands": [
                ":nohl",
            ]
        },
        {
            "before": ["leader", "w"],
            "commands": [
                "workbench.action.files.save",
            ]
        }
    ],
    "workbench.colorCustomizations": {
        "statusBar.background": "#8fbcbb",
        "statusBar.noFolderBackground": "#8FBCBB",
        "statusBar.debuggingBackground": "#8FBCBB",
        "statusBar.foreground": "#434C5E",
        "statusBar.debuggingForeground": "#434C5E"
    },
    "search.followSymlinks": false,
    "editor.cursorStyle": "line",
    "editor.insertSpaces": false,
    "editor.lineNumbers": "on",
    "editor.wordSeparators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-",
    "editor.wordWrap": "off",
    "prettier.arrowParens": "avoid",
    "prettier.useTabs": true,
    "workbench.colorTheme": "Noctis Sereno",
    "breadcrumbs.enabled": false,
    "emmet.includeLanguages": {
        "vue-html": "html",
        "vue":"html",
        "javascript":"html"
    },
    "emmet.excludeLanguages": [
    ],
    "security.workspace.trust.untrustedFiles": "open",
    "git.confirmSync": false,
    "editor.guides.bracketPairs": "active",
    "editor.bracketPairColorization.enabled": true,
    "vim.cursorStylePerMode.normal": "block",
    "vim.cursorStylePerMode.insert": "line",
    "vim.highlightedyank.enable": true,
    "vim.showMarksInGutter": true,
    "vim.autoSwitchInputMethod.defaultIM": "com.apple.keylayout.ABC",
    "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/im-select",
    "vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/im-select {im}",
    "editor.linkedEditing": true,
    "vim.smartRelativeLine": true,
    "diffEditor.ignoreTrimWhitespace": false,
    "editor.guides.indentation": false,
    "editor.unicodeHighlight.nonBasicASCII": false,
    "gopls": {
        "build.env": {
            "GOOS": "js",
            "GOARCH": "wasm"
        },
        "ui.semanticTokens": true  
    },
    "vim.autoSwitchInputMethod.enable": true,
    "terminal.integrated.defaultProfile.osx": "zsh",
    "terminal.integrated.localEchoExcludePrograms": [
        "vim",
        "vi"
    ],
    "emmet.triggerExpansionOnTab": true,
    "emmet.showSuggestionsAsSnippets": true,
    "editor.minimap.enabled": false,
    "translateVariable.baiduAppid": "20220722001280219",
    "translateVariable.baiduKey": "B65AGhhxKgnEMVU1LqVD",
    "workbench.layoutControl.enabled": false,
    "vim.shell": "/bin/zsh",
    "vim.sneak": true,
    "files.autoSave": "afterDelay",
    "masmtasm.ASM.emulator": "dosbox",
    "vim.enableNeovim": true,
    "vim.neovimConfigPath": "~/.config/nvim/init.vim",
    "vim.neovimPath": "/opt/homebrew/bin/nvim",
    "vscode-neovim.highlightGroups.highlights": {

        "Directory": "vim",
        "IncSearch": {
            "backgroundColor": "theme.editor.findMatchBackground",
            "borderColor": "theme.editor.findMatchBorder"
        },
        "Search": {
            "backgroundColor": "theme.editor.findMatchHighlightBackground",
            "borderColor": "theme.editor.findMatchHighlightBorder"
        },
        "Visual": {
            "backgroundColor": "theme.editor.selectionBackground"
        },
        "Conceal": "vim",
        "Substitute": "vim"
    },
    "vscode-neovim.neovimExecutablePaths.darwin": "/opt/homebrew/bin/nvim",
    
}
  • user snippets 个人代码片段 vue.json
{
	"vue:js" :{
		"prefix": "vue",
		"body": [
			"",
			"",
			"",
			""
		],
		"description": "vue3 setup javascript"
	},
	"vue:ts" :{
		"prefix": "vue",
		"body": [
			"",
			"",
			"",
			""
		],
		"description": "vue3 setup typescript"
	}	
}
  • keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
[
	{
		"key": "cmd+h",
		"command": "workbench.action.previousEditor"
	},
	{
		"key": "shift+cmd+[",
		"command": "-workbench.action.previousEditor"
	},
	{
		"key": "cmd+l",
		"command": "workbench.action.nextEditor"
	},
	{
		"key": "shift+cmd+]",
		"command": "-workbench.action.nextEditor"
	},
	//neovim
	//mapping jj
	{
		"command": "vscode-neovim.compositeEscape1",
		"key": "j",
		"when": "neovim.mode == insert && editorTextFocus",
		"args": "j"
	},

	//neovm end
]

你可能感兴趣的:(前端,GoLand,vscode,ide,编辑器)