【合集】vscode相关设置

1.插件设置

 1.vscode-icons设置

步骤:文件->首选项->文件图标主题->vscode-icons

参考:VsCode插件之vscode-icons

 2.c_cpp_properties.json设置

  • 插件:C/C++

  • 生成c_cpp_properties.json文件

步骤:ctrl+shift+P打开Command Palette,运行C/Cpp: Edit configurations...生成c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",        
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",  //编译器路径
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

参考:VS code 配置C/C++环境

3. better Comments

4.codeif

5.tabnine

6.indent-rainbow

7.code spell checker

8.code runner

9.parameter hints

10.trailing spaces 

2.快捷键

  • 回跳:Ctrl + Alt +  -
  • 缩进:Ctrl + [ or Ctrl + ]
  • 批量重命名:Ctrl +Shift + L
  • 上传配置:Shift + Alt + U
  • 下载配置:Shift + Alt + D

3.配置

1.VSCode 自动生成头文件的#ifndef #define #endif

参考:VSCode 自动生成头文件的#ifndef #define #endif

步骤:ctrl+shift+P打开Command Palette,输入snippets,选择用户代码片段(configure user snippets),选择全局代码片段(new global snippets file),起个名字(c_cpp_header),配置文件。

	"C C++ Header": {
		"scope": "c, cpp",
		"prefix": "header",
		"description": "Add #ifndef, #define and #endif",

		"body": [
			"#ifndef ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}",
			"#define ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}",
			"",
			"$0",
			"",
			"#endif"
		]
	}

2.标签栏显示效果设置

选中了红框中的文件,但是显示效果不突出。


 修改workbench.editor.decorations.colors,去掉勾勾

3.vscode空格间距太小

  • 修改设置中的editor.font family :monospace
  • 修改后的效果:

4.实现声明和定义跳转

  1. 创建c_cpp_properties.json文件

    ctrl+shift+P打开Command Palette,运行C/Cpp: Edit configurations...生成c_cpp_properties.json

  2. 添加文件路径

  3. 重启vscode并编译

5.vscode setting-sync设置

参考:[参考1]https://www.cnblogs.com/lychee/p/11214032.htmlhttps://www.cnblogs.com/lychee/p/11214032.html

[参考2]https://blog.csdn.net/kan2016/article/details/106527374https://blog.csdn.net/kan2016/article/details/106527374

6.vscode代码提示

设置中取消掉勾选项: 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

火柴的初心

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值