commit 05f5164505f6afc7ca63ccc7080e8e989650a400 Author: flykhan Date: Thu Apr 6 22:39:47 2023 +0800 初始化vscode配置文件 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..6936aad --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,106 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "C:\\Windows\\system32\\cmd.exe", + "args": [ + "/C", + "${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", + "&", + "pause" + ], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "internalConsoleOptions": "neverOpen", + "MIMode": "gdb", + "miDebuggerPath": "gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": false + } + ], + "preLaunchTask": "Compile" + }, + { + "name": "(gdb) Debug", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "internalConsoleOptions": "neverOpen", + "MIMode": "gdb", + "miDebuggerPath": "gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": false + } + ], + "preLaunchTask": "Compile" + }, + { + "name": "C/C++: g++.exe 生成和调试活动文件", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", + "setupCommands": [ + { + "description": "为 gdb 启用整齐打印", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "将反汇编风格设置为 Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ], + "preLaunchTask": "C/C++: g++.exe 生成活动文件" + }, + { + "name": "C/C++: gcc.exe 生成和调试活动文件", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", + "setupCommands": [ + { + "description": "为 gdb 启用整齐打印", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "将反汇编风格设置为 Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ], + "preLaunchTask": "C/C++: gcc.exe 生成活动文件" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..990423e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,109 @@ + +{ + "workbench.sideBar.location": "left", + "window.title": "${dirty}${activeEditorLong}${separator}${rootName}${separator}${appName}", + "editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?·~!¥…()—【】、;:‘’“”,。《》? ", + "files.defaultLanguage": "c++", // ctrl+N新建文件后默认的语言 + "editor.formatOnType": false, // (对于C/C++)输入分号后自动格式化当前这一行的代码 + "editor.suggest.snippetsPreventQuickSuggestions": true, // clangd的snippets有很多的跳转点,不用这个就必须手动触发Intellisense了 + "editor.acceptSuggestionOnEnter": "off", // 我个人的习惯,按回车时一定是真正的换行,只有tab才会接受Intellisense + "editor.snippetSuggestions": "inline", // (可选)snippets显示在补全列表顶端,默认是inline + "C_Cpp.clang_format_sortIncludes": true, // 格式化时调整include的顺序(按字母排序) + "C_Cpp.autocomplete": "default", // 同上;这几条也可以考虑放到全局里,否则很多错误会报两遍,cpptools一遍clangd一遍 + "C_Cpp.suggestSnippets": true, // 同上 + "editor.fontFamily": "JetBrains Mono", + "editor.fontSize": 17, // 同上 + "editor.fontLigatures": true, // 连体字,效果不太好形容,见 https://typeof.net/Iosevka 最后一部分 + "editor.minimap.enabled": false, // 我个人不用minimap,就是右边那个东西 + "editor.dragAndDrop": false, // 选中文字后,可以拖动它们调整位置。我是不需要 + "editor.cursorSmoothCaretAnimation": "on", // 移动光标时变得平滑 + "editor.smoothScrolling": false, // 滚动平滑,不过效果很微弱 + "files.trimTrailingWhitespace": true, // 保存时,删除每一行末尾的空格 + "files.insertFinalNewline": true, // 保存后文件最末尾加一整行空行,Linux下的习惯 + "files.autoGuessEncoding": true, // 启用后,会在打开文件时尝试猜测字符集编码。我关闭的理由见6,默认也是禁用的 + "workbench.settings.useSplitJSON": false, // 恢复手动编辑时的两列设置 + "window.zoomLevel": 0, // 整体放大 + "git.enabled": true, // 如果你不用git,可以考虑关闭它 + "git.ignoreMissingGitWarning": true, // 同上 + "[c]": { + "files.encoding": "utf8" // 这样的格式可以对指定后缀的文件应用设置,如果你实在想用gbk,就这样设置吧。cpp同理。 + }, + "[c++]": { + "files.encoding": "utf8" // 这样的格式可以对指定后缀的文件应用设置,如果你实在想用gbk,就这样设置吧。cpp同理。 + }, + "files.associations": { + "iostream": "cpp", + "algorithm": "cpp", + "*.tcc": "cpp", + "random": "cpp", + "fstream": "cpp", + "istream": "cpp", + "ostream": "cpp", + "regex": "cpp", + "utility": "cpp", + "array": "cpp", + "atomic": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "cfenv": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "cinttypes": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "csetjmp": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cuchar": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "forward_list": "cpp", + "list": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "functional": "cpp", + "iterator": "cpp", + "map": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "ratio": "cpp", + "set": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "scoped_allocator": "cpp", + "shared_mutex": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "valarray": "cpp", + "queue": "cpp" + }, + "C_Cpp.errorSquiggles": "Enabled", +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..e9afc2e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,70 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Compile", + "command": "g++", + "args": [ + "${file}", + "-o", + "${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", + "-g", + "-Wall", + "-static-libgcc", + "-fexec-charset=utf-8" + ], + "type": "process", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared" + }, + "problemMatcher": "$gcc" + }, + { + "type": "cppbuild", + "label": "C/C++: g++.exe 生成活动文件", + "command": "D:\\mingw64\\bin\\g++.exe", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + "detail": "调试器生成的任务。" + }, + { + "type": "cppbuild", + "label": "C/C++: gcc.exe 生成活动文件", + "command": "D:\\mingw64\\bin\\gcc.exe", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + "detail": "调试器生成的任务。" + } + ] +} \ No newline at end of file