# Windows 下

1、写入右键打开 vscode 注册表

前言:有时候在安装的时候,会忘记勾选 把 vscode添加到右键 的选项,导致后面无法方便的从右键中选着文件 or 文件夹打开。

解决:编辑以下文件,另存为 xxx.reg 文件,注意:把 D:\\Microsoft VS Code\\Code.exe 搜索替换更改为自己 vscode 的安装路径;不知道安装在哪里的,可以右键应用图标查看 "打开文件所在位置" 。

Windows Registry Editor Version 5.00
	
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
	
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%1\""
	
Windows Registry Editor Version 5.00
	
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
	
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\""
	
Windows Registry Editor Version 5.00
	
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
	
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\""

# ubuntu 下

1、vscode 超管模式执行

前言:很多时候,在 root 用户下无法打开 "Visual Studio Code 开发环境",导致无法编辑保存文件或者使用一些插件,虽说可以用 chmod 777 改变文件权限,但是这样子有点不安全,那么有没有一个办法,只有在 root 用户才能使用,正常用户下还是原有的权限呢?

解决:vscode 最好在官网上下载(https://code.visualstudio.com/updates/),从应用管理器或者利用 apt-get install 安装,目前是不支持中文编写的,可能是因为下载的是阉割版;还有值得注意的是,好像下载 V1.70 版本以上的(目前只测过 1.64 和 1.65),以管理者执行会出现白屏现象。

在安装好从官网下的包后,在 ~/.bashrc 文件中添加 alias code='/usr/share/code/code . --no-sandbox --unity-launch' 配置;然后执行 source ~/.bashrc 命令刷新配置。

最后,想要以超管执行 vscode,只需切换到 root 用户后,在命令行中执行 code ,从图标应用上打开或者在非 root 用户下执行 code 命令则皆是普通模式。

# 设置

1、差异编辑

  • Code Lens

    选择显示 CodeLens

  • ignore Trim Whitespace

    取消忽略前导或尾随空格更改

2、编辑管理

  • Enable Preview

    取消预览编辑,使得打开新文件时不会替换关闭已打开文件

3、资源管理器

  • Auto Reveal

    关闭取消侧边栏文件定位跳转

4、搜索

  • Show Line Numbers

    选择显示搜索结果所在行号

5、终端

  • Cursor Blinking

    控制终端光标闪烁

6、自动换行

  • Word Wrap
  • 直接通过快捷键 alt + z 临时进行换行与不换行之间的切换

# 常用插件

.vscode\extensions.json

{
	// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
	// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
	// List of extensions which should be recommended for users of this workspace.
	"recommendations": [
		"CodeInChinese.EnglishChineseDictionary",
		"mqycn.huile8",
		"dan-c-underwood.arm",
		"alefragnani.Bookmarks",
		"ms-vscode.cpptools",
		"MS-CEINTL.vscode-language-pack-zh-hans",
		"twxs.cmake",
		"intellsmi.comment-translate",
		"marus25.cortex-debug",
		"plorefice.devicetree",
		"mhutchie.git-graph",
		"eamodio.gitlens",
		"trond-snekvik.gnu-mapfiles",
		"ms-vscode.hexeditor",
		"keroc.hex-fmt",
		"ZixuanWang.linkerscript",
		"yzhang.markdown-all-in-one",
		"blindtiger.masm",
		"mcu-debug.memory-view",
		"eseom.nunjucks-template",
		"ms-python.python",
		"kaiyi.qwerty-learner",
		"Wscats.eno",
        "vscode-icons-team.vscode-icons"
	],
	// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
	"unwantedRecommendations": [
		
	]
}
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

夏沫の浅雨 微信支付

微信支付

夏沫の浅雨 支付宝

支付宝