ubuntu20.04配置vscode
时间: 2023-06-05 08:47:50 浏览: 230
1. 安装VSCode:打开终端,输入以下命令
```
sudo apt update
sudo apt install code
```
2. 安装常用插件:打开VSCode,按下Ctrl+Shift+X,搜索并安装以下插件
- Chinese (Simplified) Language Pack for Visual Studio Code
- GitLens — Git supercharged
- Live Server
- Prettier - Code formatter
- Bracket Pair Colorizer 2
- Path Intellisense
3. 配置VSCode:打开VSCode,按下Ctrl+Shift+P,输入“settings”,选择“Open User Settings”,在右侧的编辑器中添加以下配置
```
"editor.fontSize": 16,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"workbench.colorTheme": "Default Light+",
"workbench.iconTheme": "vscode-icons",
"terminal.integrated.fontSize": 16,
"terminal.integrated.shell.linux": "/bin/bash",
"files.autoSave": "onFocusChange",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"git.autofetch": true,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"git.defaultCloneDirectory": "~/Documents/GitHub",
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.port": 5500,
"liveServer.settings.root": "/path/to/project",
"prettier.singleQuote": true,
"prettier.trailingComma": "all",
"prettier.printWidth": 120,
"prettier.tabWidth": 2,
"prettier.useTabs": false,
"prettier.jsxSingleQuote": true,
"prettier.jsxBracketSameLine": false,
"prettier.arrowParens": "avoid",
"prettier.bracketSpacing": true,
"prettier.semi": true,
"prettier.proseWrap": "always",
"prettier.htmlWhitespaceSensitivity": "ignore",
"prettier.endOfLine": "auto",
"bracket-pair-colorizer-2.colors": [
"#FF6B6B",
"#74E9FF",
"#A9FF9D",
"#FFD86B",
"#FF74F5",
"#B2B2B2"
],
"path-intellisense.autoSlashAfterDirectory": true,
"path-intellisense.extensionOnImport": true,
"path-intellisense.showHiddenFiles": true,
"path-intellisense.ignorePatterns": [
"**/node_modules/**",
"**/bower_components/**",
"**/dist/**",
"**/build/**",
"**/coverage/**",
"**/.git/**",
"**/.svn/**",
"**/.hg/**",
"**/CVS/**",
"**/.DS_Store/**"
]
```
4. 配置中文输入法:打开终端,输入以下命令
```
sudo apt install fcitx fcitx-googlepinyin fcitx-config-gtk
```
打开“设置”->“Region & Language”,将“Input Sources”中的“English (US)”删除,添加“Chinese (Pinyin)”,然后在“Keyboard Shortcuts”中将“Switch to next source”和“Switch to previous source”分别设置为“Ctrl+Space”和“Ctrl+Shift+Space”。
5. 配置终端:打开终端,按下Ctrl+Shift+P,输入“settings”,选择“Open User Settings”,在右侧的编辑器中添加以下配置
```
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.fontFamily": "Ubuntu Mono",
"terminal.integrated.fontSize": 16,
"terminal.integrated.cursorStyle": "underline",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.scrollback": 10000,
"terminal.integrated.rightClickBehavior": "copyPaste",
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.shellArgs.linux": [
"--login"
]
```
6. 配置文件管理器:打开终端,输入以下命令
```
sudo apt install nautilus-admin nautilus-image-converter
```
打开文件管理器,右键单击文件或文件夹,选择“Open as Administrator”可以以管理员身份打开文件或文件夹;右键单击图片文件,选择“Resize Images”可以调整图片大小。
7. 配置字体:打开终端,输入以下命令
```
sudo apt install fonts-firacode
```
在VSCode的设置中将“editor.fontFamily”设置为“Fira Code”,并在“editor.fontLigatures”中添加“'ss'”。
8. 配置主题:打开终端,输入以下命令
```
sudo apt install gnome-tweaks
```
打开“Gnome Tweaks”,在“Appearance”中选择“Yaru-dark”主题,在“Fonts”中选择“Fira Code Regular”字体。
9. 配置系统:打开终端,输入以下命令
```
sudo apt update
sudo apt upgrade
sudo apt autoremove
```
以上就是Ubuntu 20.04配置VSCode的步骤。
阅读全文
相关推荐
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)