vscode config

0.插件

  • C/C++
  • C++ Intellisense
  • Doxygen Documentation Generator
  • Msg Language Support
  • XML Tools
  • Todo Tree: 注释的高亮显示
  • Chinese (Simplified)
  • CMake
  • CMake Tools
  • Comment Translate
  • Draw.io Integration (画流程图)
  • Drawio Preview
  • indent-rainbow(显示空格)
  • LeetCode
  • PlantUML(画类图)
  • ROS

eigen 代码显示红线:

首先,按下快捷键Ctrl + Shift + P,输入edit configuration,选择C/Cpp: Edit Configurations(JSON),此时会在工程的配置目录.vscode下生成一个配置文件:c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [      
                "${workspaceFolder}/**",
                "/usr/include/**",
                "/usr/local/include/**",
                 "/opt/ros/melodic/include",
                "/usr/include/eigen3"       //添加库路径
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

基本上:

"/usr/include/**",
"/usr/local/include/**",
 "/opt/ros/melodic/include",
"/usr/include/eigen3"    链接了大部分库吧

1.seetings.json

{
  "doxdocgen.generic.paramTemplate": "@param[in] {param} ",
  // 在注释中搜索以 * // , # , ; , 开头的标签! -- 或 / * 
  "todo-tree.regex.regex": "((\\*|//|#|<!--|;|/\\*|^)\\s*($TAGS)|^\\s*- \\[ \\])",
	"todo-tree.highlights.defaultHighlight": {
    "icon": "alert",
    "type": "text",
    "foreground": "red",
    "iconColour": "green"
	},
	"todo-tree.general.tags": [
    "?",
    "!",
    "param",
    "step",
    "Step",
    "c++11",
    "note",
    "tag",
    "todo",
	],
	"todo-tree.highlights.customHighlight": {
    "?": {
      "icon": "question",
      "foreground": "#CCFF33",
      "iconColour": "#CCFF33",
      "type": "text-and-comment"
    },
    "!": {
      "foreground": "red",
      "icon": "issue-opened",
      "iconColour": "red",
      "type": "text-and-comment"
    },
    "step": {
      "foreground": "#7CFC00",
      "icon": "question",
      "iconColour": "green",
      "type": "text-and-comment",
      "hideFromTree": true
    },
    "Step": {
      "foreground": "#7CFC00",
      "icon": "question",
      "iconColour": "green",
      "type": "text-and-comment",
      "hideFromTree": true
    },
    "c++11": {
      "icon": "tag",
      "foreground": "violet",
      "rulerColour": "violet",
      "iconColour": "violet",
      "type": "text-and-comment",
    },
    "note": {
      "icon": "note",
      "foreground": "#00BFFF",
      "rulerColour": "#00BFFF",
      "iconColour": "#00BFFF",
      "type": "text-and-comment",
    },
    "param": {
      "icon": "issue-closed",
      "foreground": "#48D1CC",
      "rulerColour": "#48D1CC",
      "iconColour": "#48D1CC",
      "type": "text-and-comment",
    },
    "tag": {
      "icon": "tag",
      "foreground": "#00FF7F",
      "rulerColour": "#00FF7F",
      "iconColour": "#00FF7F",
      "rulerLane": "full",
      "type": "text-and-comment",
    },
    "todo": {
      "foreground": "#f90",
      "rulerColour": "#f90",
      "iconColour": "#f90",
      "type": "text-and-comment",
    },
	},
  "python.autoComplete.extraPaths": [
    "/opt/ros/melodic/lib/python2.7/dist-packages"
  ],
  "todo-tree.tree.showBadges": false,
	"todo-tree.general.revealBehaviour": "highlight todo",
	"todo-tree.tree.showCountsInTree": true,
	"todo-tree.filtering.excludeGlobs":[
	"**/*.txt",
	"**/*.md"
	],
	"files.associations": {
		"*.cc": "cpp",
		"vector": "cpp",
		"mutex": "cpp",
		"list": "cpp",
		"xtree": "cpp",
		"map": "cpp",
		"algorithm": "cpp",
		"bitset": "cpp",
		"cctype": "cpp",
		"chrono": "cpp",
		"cmath": "cpp",
		"concepts": "cpp",
		"cstdarg": "cpp",
		"cstddef": "cpp",
		"cstdint": "cpp",
		"cstdio": "cpp",
		"cstdlib": "cpp",
		"cstring": "cpp",
		"ctime": "cpp",
		"cwchar": "cpp",
		"deque": "cpp",
		"exception": "cpp",
		"fstream": "cpp",
		"initializer_list": "cpp",
		"iomanip": "cpp",
		"ios": "cpp",
		"iosfwd": "cpp",
		"iostream": "cpp",
		"istream": "cpp",
		"iterator": "cpp",
		"limits": "cpp",
		"memory": "cpp",
		"new": "cpp",
		"numeric": "cpp",
		"ostream": "cpp",
		"queue": "cpp",
		"ratio": "cpp",
		"set": "cpp",
		"sstream": "cpp",
		"stack": "cpp",
		"stdexcept": "cpp",
		"streambuf": "cpp",
		"string": "cpp",
		"system_error": "cpp",
		"thread": "cpp",
		"tuple": "cpp",
		"type_traits": "cpp",
		"typeinfo": "cpp",
		"unordered_map": "cpp",
		"utility": "cpp",
		"xfacet": "cpp",
		"xhash": "cpp",
		"xiosbase": "cpp",
		"xlocale": "cpp",
		"xlocinfo": "cpp",
		"xlocmon": "cpp",
		"xlocnum": "cpp",
		"xloctime": "cpp",
		"xmemory": "cpp",
		"xstddef": "cpp",
		"xstring": "cpp",
		"xtr1common": "cpp",
		"xutility": "cpp"
	},

	"commentTranslate.source": "Google",
	"commentTranslate.targetLanguage": "zh-CN",
  "powermode.enabled": true,
	"markdown-preview-enhanced.previewTheme": "one-dark.css",
	"markdown-preview-enhanced.breakOnSingleNewLine": false,
	"markdown-preview-enhanced.codeBlockTheme": "one-dark.css",
	"markdown-preview-enhanced.pandocArguments": [
		{
			"output":{
				"pdf_document":{
					"toc": true,
					"toc_depth": 4,
					"number_sections": true,
					"highlight": "tango"
				}
			} 
		}
	],
	"debug.onTaskErrors": "debugAnyway",
	"[cpp]": {
		"editor.defaultFormatter": "ms-vscode.cpptools"
	},
	"typescript.disableAutomaticTypeAcquisition": true,
	"C_Cpp.errorSquiggles": "Enabled",
	"clang.cxxflags": [
		"-std=c++11"
	],
	"C_Cpp.updateChannel": "Insiders",
	"files.autoSave": "afterDelay",
	"fileheader.Author": "bFeng",
	"fileheader.LastModifiedBy": "bFeng",
	"fileheader.tpl": "// Create by {author}. {createTime}",
	"fileheader.customMade": {
		"Date": "Do not edit", 
		"Author": "bFeng",
	},
"editor.detectIndentation": false,
"leetcode.endpoint": "leetcode-cn",
"leetcode.workspaceFolder": "/home/q/.leetcode",
"C_Cpp.clang_format_fallbackStyle": "Google",
"editor.tabSize": 2,
"powermode.shake.intensity": 0,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"[c]": {
  "editor.defaultFormatter": "ms-vscode.cpptools"
},
"todo-tree.general.tagGroups": {

}
}

2.tasks.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "catkin_make",
            "type": "shell",
            "command": "catkin_make_isolated --install --use-ninja", // catkin_make
            "args": [],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "reveal": "always"
            },
            "problemMatcher": "$msCompile"
        },
    ]
}

3.launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [

        {
            "name": "(gdb) Launch test_code",         // 配置名称, 将会在调试配置下拉列表中显示
            "type": "cppdbg",               // 调试器类型 该值自动生成 
            "request": "launch",            // 调试方式,还可以选择attach 
            "program": "${workspaceRoot}/devel/lib/beginner_tutorials/test_node",     //要调试的程序(完整路径, 支持相对路径)
            "args": [],                     // 传递给上面程序的参数, 没有参数留空即可
            "stopAtEntry": false,           // 是否停在程序入口点(停在main函数开始)
            "cwd": "${workspaceFolder}",    // 调试程序时的工作目录
            "environment": [],              // 针对调试的程序, 要添加到环境中的环境变量. 例如: [ { "name": "squid", "value": "clam" } ]
            "externalConsole": false,       // 如果设置为true, 则为应用程序启动外部控制台. 如果为false, 则不会启动控制台, 并使用VS Code的内置调试控制台.
            "MIMode": "gdb",                // VSCode要使用的调试工具
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

4.c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64",
            "compileCommands": "${workspaceFolder}/build_isolated/cartographer/install/compile_commands.json"
        }
    ],

    "version": 4
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在VS Code中使用Git可以通过以下步骤进行设置和操作。首先,你需要在VS Code的设置文件settings.json中设置git的路径,可以通过点击"Edit in settings.json"来编辑该文件,并在其中设置"git.path"为你的git.exe的路径,例如"E:/englishInstall/Git/cmd/git.exe"。\[1\] 其次,你可以在VS Code的编辑器中将终端设置为Git Bash,这样可以方便地知道当前所在的分支,并且界面也更美观。默认情况下,VS Code显示的是系统的cmd终端,你可以切换为Git Bash终端。\[1\] 如果你在使用https连接进行git clone下载代码时,每次进行git pull/push到远程仓库时都需要输入账号和密码,这可能会很麻烦。为了避免频繁输入账号和密码,你可以将账号和密码配置到git的全局设置中,使用以下命令进行配置:\[2\] ``` git config --global user.name "your_username" git config --global user.email "your_email" git config --global user.password "your_password" ``` 这样,当你进行git pull/push操作时,就不再需要手动输入账号和密码了。\[3\] 通过以上设置和操作,你就可以在VS Code中方便地使用Git进行版本控制了。 #### 引用[.reference_title] - *1* *2* *3* [vscode使用git](https://blog.csdn.net/qq_38210427/article/details/130027520)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值