vscode系统setting

  1. {
  2. // 控制是否显示 minimap
  3. "editor.minimap.enabled": false,
  4. // 以像素为单位控制字号。
  5. "editor.fontSize": 20,
  6. // 按住 Ctrl 键并滚动鼠标滚轮可缩放编辑器字体大小
  7. "editor.mouseWheelZoom": true,
  8. // 控制延迟多少毫秒后将显示快速建议
  9. "editor.quickSuggestionsDelay": 0,
  10. // 控制是否在再次打开命令面板时恢复上一次的输入内容。
  11. "workbench.commandPalette.preserveInput": true,
  12. // 克隆 Git 存储库的默认位置
  13. "git.defaultCloneDirectory": "E:\\learn\\vscode\\git",
  14. "git.autofetch": true,
  15. "git.confirmSync": false,
  16. "git.enableSmartCommit": true,
  17. "explorer.confirmDelete": false,
  18. "explorer.confirmDragAndDrop": false,
  19. //"java.home": "D:\\JDK\\10",
  20. "files.autoSave": "afterDelay",
  21. "files.encoding": "utf8",
  22. "workbench.statusBar.feedback.visible": false,
  23. "python.pythonPath": "E:\\software\\python3.6",
  24. "python.linting.enabled": false,
  25. "workbench.colorTheme": "One Dark Pro",
  26. "code-runner.runInTerminal": true, // 设置成false会在“输出”中输出,无法输入
  27. "code-runner.executorMap": {
  28. "javascript": "node",
  29. "php": "C:\\php\\php.exe",
  30. "python": "python",
  31. "html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
  32. "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
  33. "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
  34. }, // 设置code runner的命令行
  35. "code-runner.saveFileBeforeRun": true, // run code前保存
  36. "code-runner.preserveFocus": true, // 若为falserun code后光标会聚焦到终端上。如果需要频繁输入数据可设为false
  37. "code-runner.clearPreviousOutput": false, // 每次run code前清空属于code runner的终端消息
  38. "C_Cpp.clang_format_sortIncludes": true, // 格式化时调整include的顺序(按字母排序)
  39. }

git配置gitub的ssh设置

  1. 异常解决,初始化数据库,然后重新克隆
  2. 打开git-bash.exe
  3. cd ~/.ssh/ 【如果没有对应的文件夹,则执行 mkdir ./.ssh
  4. git config --global user.name "xyz1178700373"
  5. git config --global user.email "1178700373@qq.com"
  6. ssh-keygen -t rsa -C "1178700373@qq.com"
  7. 按三次回车,最后在.ssh文件夹下得到id_rsaid_rsa.pub两个文件。
  8. 将私钥添加到 ssh-agent
  9. 输入以下命令打开 ssh-agent
  10. eval "$(ssh-agent -s)"
  11. 输入以下命令将私钥添加到 ssh-agent
  12. ssh-add ~/.ssh/id_rsa
  13. 添加 SSH Key
  14. /* windows 系统 */
  15. clip < ~/.ssh/id_rsa.pub
  16. /* macOS 系统 */
  17. pbcopy < ~/.ssh/id_rsa.pub
  18. /* Linux 系统 */
  19. sudo apt-get install xclip
  20. xclip -sel clip < ~/.ssh/id_rsa.pub
  21. C:\Users\11787\.ssh 使用公钥 gitubsettingssh
  22. id_rsa中的内容便是私钥,id_rsa.pub中的内容便是公钥。
  23. 测试连接(必须测试)
  24. ssh -T git@github.com
  25. ssh克隆方式 打开VS code 执行git克隆 git@github.com:xyz1178700373/xiaohao.git
  26. git中直接输入任意消息提交, ****然后点击推送****

vscode c++ 运行环境配置

.vscode.zip
下面是四个文件内容,在.vscode文件夹下。

c_cpp_properties.json

  1. {
  2. "configurations": [
  3. {
  4. "name": "Win32",
  5. "includePath": [
  6. "${workspaceFolder}"
  7. ],
  8. "defines": [
  9. "_DEBUG",
  10. "UNICODE"
  11. ],
  12. "compilerPath":"E:\\software\\MinGW\\bin\\g++.exe",
  13. "intelliSenseMode": "clang-x64",
  14. "browse": {
  15. "path": [
  16. "${workspaceFolder}"
  17. ],
  18. "limitSymbolsToIncludedHeaders": true,
  19. "databaseFilename": ""
  20. }
  21. }
  22. ],
  23. "version": 4
  24. }

launch.json

  1. {
  2. "version": "0.2.0",
  3. "configurations": [
  4. {
  5. "name": "(gdb) Launch", // 配置名称,将会在启动配置的下拉菜单中显示
  6. "type": "cppdbg", // 配置类型,这里只能为cppdbg
  7. "request": "launch", // 请求配置类型,可以为launch(启动)或attach(附加)
  8. "program": "${workspaceRoot}/${fileBasenameNoExtension}.exe",// 将要进行调试的程序的路径
  9. "args": [], // 程序调试时传递给程序的命令行参数,一般设为空即可
  10. "stopAtEntry": false, // 设为true时程序将暂停在程序入口处,一般设置为false
  11. "cwd": "${workspaceRoot}", // 调试程序时的工作目录,一般为${workspaceRoot}即代码所在目录
  12. "environment": [],
  13. "externalConsole": true, // 调试时是否显示控制台窗口,一般设置为true显示控制台
  14. "internalConsoleOptions": "neverOpen", // 如果不设为neverOpen,调试时会跳到“调试控制台”选项卡
  15. "MIMode": "gdb", // 指定连接的调试器,可以为gdblldb。但目前lldbwindows下没有预编译好的版本。
  16. "miDebuggerPath": "gdb.exe", // 调试器路径,Windows下后缀不能省略,Linux下则去掉
  17. "preLaunchTask": "taskcpp", // 调试会话开始前执行的任务,一般为编译程序,c++为g++, cgcc
  18. "setupCommands": [
  19. {
  20. "description": "Enable pretty-printing for gdb",
  21. "text": "-enable-pretty-printing",
  22. "ignoreFailures": true
  23. }
  24. ]
  25. },
  26. {
  27. "name": "python",
  28. "type": "python",
  29. "request": "launch",
  30. "stopOnEntry": false,
  31. "pythonPath": "${config:python.pythonPath}",
  32. "program": "${file}",
  33. "cwd": "",
  34. "console": "externalTerminal",
  35. "env": {},
  36. "envFile": "${workspaceRoot}/.env",
  37. }
  38. ]
  39. }

settings.json

  1. {
  2. "C_Cpp.intelliSenseEngineFallback": "Enabled"
  3. }

tasks.json

  1. {
  2. "version": "2.0.0",
  3. "tasks": [
  4. {
  5. "label": "taskcpp",
  6. "type": "shell",
  7. "command": "g++",
  8. "args": [
  9. "-g",
  10. "${file}",
  11. "-o",
  12. "${fileBasenameNoExtension}.exe"
  13. ], // 编译命令参数
  14. "group": {
  15. "kind": "build",
  16. "isDefault": true // 设为false可做到一个tasks.json配置多个编译指令,需要自己修改本文件,我这里不多提
  17. },
  18. "presentation": {
  19. "echo": true,
  20. "reveal": "never", // 在“终端”中显示编译信息的策略,可以为alwayssilentnever。具体参见VSC的文档
  21. "focus": false, // 设为true后可以使执行task时焦点聚集在终端,但对编译cc++来说,设为true没有意义
  22. "panel": "shared" // 不同的文件的编译信息共享一个终端面板
  23. }
  24. }
  25. ]
  26. }

vscode其他配置相关

  1. # 配置环境变量 path 中添加
  2. # E:\software\MinGW\bin
  3. 用户设置加入
  4. "python.pythonPath": "E:\\software\\python3.6",
  5. "python.linting.enabled": false,