赞
踩
打开常用命令集:ctrl + shift +p
重新加载窗口:F1
不能跳转了—重新加载一下窗口
Ctrl + z 回撤
Ctrl + y 前进
atl + shift +a 块注释
保存时自动去空格
1.点左下角齿轮图标,再点setting(也可用Ctrl + , 快捷键打开Settings文件)
2.搜索files.trimTrailingWhitespace,将选项勾选
3.关闭Settings标签页
4.回到需要处理的文件按Ctrl + s保存即自动去除行尾空格
Please install clang or check configuration clang.executable
linux:https://www.jianshu.com/p/fb0148da66e2
windows:https://blog.csdn.net/shouwangyunkai666/article/details/98446682
实现跳转:
① 安装插件clangd 卸载C++所有插件
② cp cmake_build目录下的cmopile_commands.json到主目录 等左下角的所有indexing完(如果只装clangd 不进行这一步 会程序里各种红色波浪线报错 加上这一步不仅可以去红色波浪线 而且可以智能修复(alt + shift + .))
③ settings.json格式写对
实现自动格式化:
①设置里搜format 勾上Format On Type Format On Save
②编辑setting.json
{ "remote.SSH.remotePlatform": { "xuerui": "linux" }, "code-runner.runInTerminal": true, "clangd.path": "c:\\Users\\int.rui.xue\\AppData\\Roaming\\Code\\User\\globalStorage\\llvm-vs-code-extensions.vscode-clangd\\install\\13.0.0\\clangd_13.0.0\\bin\\clangd.exe", "clangd.detectExtensionConflicts": false, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" }, "clang-format.fallbackStyle": "Google", "cmake.configureOnOpen": true, "editor.suggestSelection": "first", "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", "workbench.iconTheme": "vscode-icons", "files.trimTrailingWhitespace": true, "python.formatting.autopep8Args": [ "\"python.formatting.provider\": \"yapf\"" ], "python.formatting.provider": "yapf", "editor.fontSize": 16, "emmet.excludeLanguages": [ "markdown" ], // vscode默认启用了根据文件类型自动设置tabsize的选项 "editor.detectIndentation": true, // // 重新设定tabsize "editor.tabSize": 4, // #每次保存的时候自动格式化 "editor.formatOnSave": true, "editor.formatOnSaveMode": "modifications", // "editor.defaultFormatter": "xaver.clang-format", "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4,}", "C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, }", // "[cpp]": { // "editor.defaultFormatter": "ms-vscode.cpptools" // }, "C_Cpp.formatting": "Default", "json.maxItemsComputed": 50000, "editor.formatOnType": true, // "C_Cpp.vcFormat.indent.accessSpecifiers": true, }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。