Skip to content

Instantly share code, notes, and snippets.

@mferoc
Last active November 13, 2024 18:33
Show Gist options
  • Save mferoc/7b76f9477e0f76befc7161800d9723f7 to your computer and use it in GitHub Desktop.
Save mferoc/7b76f9477e0f76befc7161800d9723f7 to your computer and use it in GitHub Desktop.
Config vscode environment for 42 school
root = true
[*]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Add in your vscode inside "settings.json" file
"editor.tabSize": 4,
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"editor.renderWhitespace": "all",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
{
"version": "2.0.0",
"configurations": [
{
"name": "C Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/a.out",
"preLaunchTask": "build",
"internalConsoleOptions": "openOnSessionStart",
"logging": {
"moduleLoad": false,
"programOutput": true,
"trace": false
},
"showDisplayString": false,
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true, // set true to enable keyboard input
"osx": {
"MIMode": "lldb"
}
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "clang",
"args": [
"get_next_line.c",
"get_next_line_utils.c",
"-g"
],
"type": "shell",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared"
},
"problemMatcher": {
"owner": "c",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
@AtfishBlob
Copy link

AtfishBlob commented Jun 23, 2023

I had the similar project at school, so try this source https://assignmentbro.com/ca/do-my-assignment or the tips I'm sharing with you now

Create or update the .editorconfig file in your project's root directory with the following contents:

root = true

[*]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

Create or update the settings.json file in your VSCode workspace. Add the following configurations:

{
"editor.tabSize": 4,
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"editor.renderWhitespace": "all",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
}
Create or update the launch.json file in your VSCode workspace. Add the following configuration for C launch:

{
"version": "2.0.0",
"configurations": [
{
"name": "C Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/a.out",
"preLaunchTask": "build",
"internalConsoleOptions": "openOnSessionStart",
"logging": {
"moduleLoad": false,
"programOutput": true,
"trace": false
},
"showDisplayString": false,
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true, // set true to enable keyboard input
"osx": {
"MIMode": "lldb"
}
}
]
}
Create or update the tasks.json file in your VSCode workspace. Add the following task configuration for building C files:

{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "clang",
"args": [
"get_next_line.c",
"get_next_line_utils.c",
"-g"
],
"type": "shell",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared"
},
"problemMatcher": {
"owner": "c",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.):(\d+):(\d+):\s+(warning|error):\s+(.)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
These configurations set the indentation style, tab size, whitespace handling, and build settings according to the 42 School's norminette guidelines. You can adjust the file and build configurations as per your project requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment