Skip to content

Commit 02473dc

Browse files
committed
添加之前代码
0 parents  commit 02473dc

File tree

15 files changed

+769
-0
lines changed

15 files changed

+769
-0
lines changed

.vimrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
" 编译运行
3+
nnoremap <F5> :w<CR> :call CompileRun()<CR>
4+
func! CompileRun()
5+
if &filetype == 'c'
6+
exec "!echo 'clang % -o ./build/%:t:r -I./include && ./build/%:t:r' && clang % -o ./build/%:t:r -I./include && ./build/%:t:r"
7+
elseif &filetype == 'cpp'
8+
exec "!echo 'clang++ % -o ./build/%:t:r -I./include -std=c++17 && ./build/%:t:r' && clang++ % -o ./build/%:t:r -I./include -std=c++17 && ./build/%:t:r"
9+
endif
10+
endfunc
11+

.vscode/c_cpp_properties.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"browse": {
6+
"path": [
7+
"${workspaceFolder}",
8+
"${workspaceFolder}/include"
9+
],
10+
"limitSymbolsToIncludedHeaders": true
11+
},
12+
"includePath": [
13+
"${workspaceFolder}",
14+
"${workspaceFolder}/include"
15+
],
16+
"defines": [],
17+
"compilerPath": "/usr/bin/clang",
18+
"cStandard": "c11",
19+
"cppStandard": "c++17",
20+
"intelliSenseMode": "clang-x64"
21+
},
22+
{
23+
"name": "MinGW",
24+
"browse": {
25+
"path": [
26+
"${workspaceFolder}",
27+
"${workspaceFolder}/include"
28+
29+
],
30+
"limitSymbolsToIncludedHeaders": true
31+
},
32+
"includePath": [
33+
"${workspaceFolder}",
34+
"${workspaceFolder}/include"
35+
],
36+
"defines": [],
37+
"compilerPath": "C:/Program Files/LLVM/bin/gcc.exe",
38+
"cStandard": "c11",
39+
"cppStandard": "c++17",
40+
"intelliSenseMode": "clang-x64"
41+
}
42+
43+
],
44+
"version": 4
45+
}

.vscode/launch.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
5+
{
6+
"name": "Linux Debug", // 配置名称,将会在启动配置的下拉菜单中显示
7+
"type": "lldb", // 配置类型,这里只能为cppdbg
8+
"request": "launch", // 请求配置类型,可以为launch(启动)或attach(附加)
9+
"program": "${workspaceFolder}/build/${fileBasenameNoExtension}", // 将要进行调试的程序的路径
10+
"args": [
11+
"."
12+
], // 程序调试时传递给程序的命令行参数,一般设为空即可
13+
"cwd": "${workspaceFolder}/build", // 调试程序时的工作目录
14+
"terminal": "integrated",
15+
"stopOnEntry": false,
16+
"preLaunchTask": "Linux Compile" // 调试会话开始前执行的任务,一般为编译程序。与tasks.json的label相对应,
17+
18+
},
19+
{
20+
"name": "Windows Debug",
21+
"type": "gdb",
22+
"request": "launch",
23+
"target": "${workspaceFolder}/build/${fileBasenameNoExtension}.exe",
24+
"cwd": "${workspaceFolder}/build",
25+
"arguments": "",
26+
"preLaunchTask": "Windows Compile",
27+
"valuesFormatting": "prettyPrinters",
28+
"terminal": ""
29+
},
30+
]
31+
}

.vscode/settings.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"files.associations": {
3+
"system_error": "cpp",
4+
"type_traits": "cpp",
5+
"algorithm": "cpp",
6+
"list": "cpp",
7+
"iostream": "cpp",
8+
"iosfwd": "cpp",
9+
"array": "cpp",
10+
"atomic": "cpp",
11+
"*.tcc": "cpp",
12+
"bitset": "cpp",
13+
"cctype": "cpp",
14+
"cfenv": "cpp",
15+
"chrono": "cpp",
16+
"cinttypes": "cpp",
17+
"clocale": "cpp",
18+
"cmath": "cpp",
19+
"codecvt": "cpp",
20+
"condition_variable": "cpp",
21+
"csetjmp": "cpp",
22+
"csignal": "cpp",
23+
"cstdarg": "cpp",
24+
"cstddef": "cpp",
25+
"cstdint": "cpp",
26+
"cstdio": "cpp",
27+
"cstdlib": "cpp",
28+
"cstring": "cpp",
29+
"ctime": "cpp",
30+
"cuchar": "cpp",
31+
"cwchar": "cpp",
32+
"cwctype": "cpp",
33+
"deque": "cpp",
34+
"forward_list": "cpp",
35+
"unordered_map": "cpp",
36+
"unordered_set": "cpp",
37+
"vector": "cpp",
38+
"exception": "cpp",
39+
"fstream": "cpp",
40+
"functional": "cpp",
41+
"future": "cpp",
42+
"initializer_list": "cpp",
43+
"iomanip": "cpp",
44+
"istream": "cpp",
45+
"limits": "cpp",
46+
"memory": "cpp",
47+
"mutex": "cpp",
48+
"ostream": "cpp",
49+
"numeric": "cpp",
50+
"ratio": "cpp",
51+
"scoped_allocator": "cpp",
52+
"shared_mutex": "cpp",
53+
"sstream": "cpp",
54+
"stdexcept": "cpp",
55+
"streambuf": "cpp",
56+
"thread": "cpp",
57+
"tuple": "cpp",
58+
"typeindex": "cpp",
59+
"typeinfo": "cpp",
60+
"utility": "cpp",
61+
"valarray": "cpp",
62+
"string": "cpp",
63+
"regex": "cpp",
64+
"memory_resource": "cpp",
65+
"string_view": "cpp",
66+
"queue": "cpp",
67+
"dirent.h": "c",
68+
"apue.h": "c"
69+
},
70+
71+
}

.vscode/tasks.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// https://code.visualstudio.com/docs/editor/tasks
2+
{
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"label": "Linux Compile", // 任务名称,与launch.json的preLaunchTask相对应
7+
"command": "clang", // 要使用的编译器
8+
"args": [
9+
"${file}",
10+
"-o", // 指定输出文件名,不加该参数则默认输出a.exe
11+
"${workspaceFolder}/build/${fileBasenameNoExtension}",
12+
"-g", // 生成和调试有关的信息
13+
"-Wall", // 开启额外警告
14+
"-static-libgcc", // 静态链接
15+
//"-fcolor-diagnostics",
16+
//"--target=x86_64-w64-mingw", // 默认target为msvc,不加这一条就会找不到头文件
17+
"-std=c11", // C语言最新标准为c11,或根据自己的需要进行修改
18+
"-I${workspaceRoot}/include"
19+
],
20+
"presentation": {
21+
"echo": true,
22+
"reveal": "always",
23+
"focus": true,
24+
"panel": "shared"
25+
}
26+
27+
},
28+
{
29+
"label": "Windows Compile", // 任务名称,与launch.json的preLaunchTask相对应
30+
"command": "clang", // 要使用的编译器
31+
"args": [
32+
"${file}",
33+
"-o", // 指定输出文件名,不加该参数则默认输出a.exe
34+
"${workspaceFolder}/build/${fileBasenameNoExtension}.exe",
35+
"-g", // 生成和调试有关的信息
36+
"-Wall", // 开启额外警告
37+
// "-static-libgcc", // 静态链接
38+
"-fcolor-diagnostics",
39+
"--target=x86_64-w64-windows-gnu", // 默认target为msvc,不加这一条就会找不到头文件
40+
"-std=c11", // C语言最新标准为c11,或根据自己的需要进行修改
41+
"-I${workspaceRoot}/include"
42+
],
43+
"presentation": {
44+
"echo": true,
45+
"reveal": "always",
46+
"focus": true,
47+
"panel": "shared"
48+
}
49+
50+
51+
},
52+
53+
]
54+
}

0 commit comments

Comments
 (0)