Open seungwonme opened 1 year ago
// tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "LLDB", // launch.json의 preLaunchTask와 일치
"command": "/usr/bin/gcc",
"args": [
"-fdiagnostics-color=always", // 컴파일러가 출력 메시지에 색상을 추가하여 가독성을 높임
"-g", // 디버깅 정보를 컴파일된 바이너리에 포함
"-O0", // 최적화를 끄고 예측 가능한 코드 형태로 컴파일
"-Wall", // 모든 경고를 출력하여 잠재적인 문제 검사
"-Wextra",
"-fsanitize=address", // AddressSanitizer를 활성화하여 메모리 오류를 감지
"-fno-omit-frame-pointer", // 프레임 포인터를 생략하지 않고 유지
"${file}", // 컴파일할 소스 파일의 경로를 지정
"-o", // 컴파일된 실행 파일의 이름과 경로를 지정
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"], // 컴파일러 오류 및 경고 메시지를 처리하는 방법을 지정
"group": "build",
"detail": "compiler: /usr/bin/gcc"
}
]
}
// launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "lldb",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"cwd": "${fileDirname}",
"preLaunchTask": "LLDB", // tasks.json의 task label과 일치
}
]
}
// setting.json
{
"lldb.displayFormat": "auto",
"lldb.dereferencePointers": true,
"lldb.consoleMode": "commands",
"lldb.showDisassembly": "auto"
}
c.json
{
"c!": {
"prefix": "c!",
"body": [
"#include <stdio.h>",
"#include <stdlib.h>",
"#include <string.h>",
"",
"int\tmain(void)",
"{",
"\t$0",
"\treturn (0);",
"}",
],
"description": "make main func"
},
"ic": {
"prefix": "ic",
"body": [
"#include $0",
],
"description": "make main func"
},
"ret": {
"prefix": "ret",
"body": [
"return ($0);",
],
"description": "return"
},
"leak": {
"prefix": "leak",
"body": [
"void\tleak(void)",
"{",
"\tsystem(\"leaks $1a.out > leaks_result_temp; cat leaks_result_temp | grep leaked && rm -rf leaks_result_temp\");",
"}",
"$2atexit(leak);"
],
"description": "check memory leaks"
},
"rm": {
"prefix": "rm",
"body": [
"$0",
"remove(\"a.out\");",
"remove(\"tempCodeRunnerFile.c\");",
],
"description": "remove files"
},
}
cpp.json
{
"c!": {
"prefix": "c!",
"body": [
"#include <iostream>",
"#include <string>",
"#include <vector>",
"#include <algorithm>",
"#define int long long",
"using namespace std;",
"",
"unsigned\tmain()",
"{",
"\t$0",
"\treturn (0);",
"}",
],
"description": "make main func"
},
"ret": {
"prefix": "ret",
"body": [
"return ($0);",
],
"description": "return"
},
"leak": {
"prefix": "leak",
"body": [
"",
"void\tleak(void)",
"{",
"\tsystem(\"leaks a.out > leaks_result_temp; cat leaks_result_temp | grep leaked && rm -rf leaks_result_temp\");",
"}",
"$0atexit(leak);"
],
"description": "check memory leaks"
},
"rm": {
"prefix": "rm",
"body": [
"$0",
"remove(\"a.out\");",
"remove(\"tempCodeRunnerFile.cpp\");",
],
"description": "remove files"
},
"ios": {
"prefix": "ios",
"body": [
"ios::sync_with_stdio(false), cin.tie(nullptr);",
],
"description": "cin/cout에서 입출력으로 인한 시간초과를 막기 위해 (절대 cout, printf를 섞어쓰면 안된다.)"
},
}
[
{
"key": "alt+cmd+up",
"command": "cursorColumnSelectUp",
"when": "textInputFocus"
},
{
"key": "alt+cmd+down",
"command": "cursorColumnSelectDown",
"when": "textInputFocus"
},
{
"key": "alt+f",
"command": "notebook.formatCell",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && inCompositeEditor && notebookEditable && !editorReadonly && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "alt+f",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "alt+f",
"command": "editor.action.formatDocument.none",
"when": "editorTextFocus && !editorHasDocumentFormattingProvider && !editorReadonly"
},
{
"key": "cmd+m",
"command": "editor.debug.action.openDisassemblyView"
},
{
"key": "cmd+;",
"command": "terminal.focus"
},
{
"key": "cmd+;",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+z",
"command": "workbench.action.toggleActivityBarVisibility"
},
{
"key": "ctrl+shift+p",
"command": "workbench.view.extension.project-manager"
},
{
"key": "shift+cmd+c",
"command": "workbench.panel.chatSidebar.copilot"
},
{
"key": "ctrl+cmd+i",
"command": "-workbench.panel.chatSidebar.copilot"
},
{
"key": "ctrl+shift+t",
"command": "workbench.action.terminal.openNativeConsole",
"when": "!terminalFocus"
},
{
"key": "shift+cmd+c",
"command": "-workbench.action.terminal.openNativeConsole",
"when": "!terminalFocus"
},
{
"key": "ctrl+shift+f",
"command": "workbench.view.extension.figma"
},
]
export ZSH="$HOME/.oh-my-zsh"
export PATH="$HOME/goinfre/brew/bin:$PATH"
export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH"
# code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
ZSH_THEME="robbyrussell"
source $ZSH/oh-my-zsh.sh
plugins=(git)
# 42 Seoul
export MAIL='seunan@student.42seoul.kr'
alias norm='norminette -R CheckForbiddenSourceHeader'
alias francinette='/Users/seunan/francinette/tester.sh' # 클러맥
alias paco='~/francinette/tester.sh'
alias pacos='paco --strict'
# git
alias gcw='gcc -Wall -Wextra -Werror'
alias gcf='gcc -g3 -fsanitize=memory -Wall -Wextra -Werror'
alias gpw='g++ -Wall -Wextra -Werror'
alias gpf='g++ -g3 -fsanitize=memory -Wall -Wextra -Werror'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gsh='git stash'
alias gp='git push'
alias gpl='git pull'
alias gm='git merge'
alias gd='git diff'
alias gl='git log'
alias glo='git log --oneline'
alias gch='git checkout'
alias gsw='git switch'
alias gb='git branch'
alias gig='git config core.ignorecase false'
# 42Seoul_Setting.zsh
rm -rf brew
if [[ -d "$HOME/goinfre/42cursus" ]]
then
echo "- the directory exists. : ~/goinfre/42cursus"
else
git clone https://github.com/seungwonme/42cursus.git $HOME/goinfre/42cursus
echo "- the directory added. : ~/goinfre/42cursus"
fi
if [[ -d "$HOME/goinfre/algorithm" ]]
then
echo "- the directory exists. : ~/goinfre/algorithm"
else
git clone https://github.com/seungwonme/Algorithm.git $HOME/goinfre/algorithm
echo "- the directory added. : ~/goinfre/algorithm"
fi
if [[ -d "$HOME/goinfre/til" ]]
then
echo "- the directory exists. : ~/goinfre/til"
else
git clone https://github.com/seungwonme/TIL.git $HOME/goinfre/til
echo "- the directory added. : ~/goinfre/til"
fi
if [[ -d "$HOME/brew" ]]
then
echo "- the directory exists. : ~/brew"
else
mkdir brew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C brew
echo "- the directory added. : ~/brew"
fi
brew update
# 42Seoul_Cache.zsh
rm -rf "/Users/$USER/Library/Caches"
rm -rf "/Users/$USER/Library/Containers/"
rm -rf "/Users/$USER/Library/Application Support/Code/User/workspaceStorage"
rm -rf "/Users/$USER/Library/Application Support/Code/Cache"
rm -rf "/Users/$USER/Library/Application Support/Code/CachedData"
rm -rf "/Users/$USER/Library/Application Support/Code/Code Cache"
rm -rf "/Users/$USER/Library/Application Support/Code/CachedExtensions"
rm -rf "/Users/$USER/Library/Application Support/Code/CachedExtensionVSIXs"
rm -rf "/Users/$USER/Library/Application Support/Slack/Service Worker"
rm -rf "/Users/$USER/Library/Application Support/Slack/Cache"
rm -rf "/Users/$USER/Library/Application Support/Slack/CachedData"
rm -rf "/Users/$USER/Library/Application Support/Slack/Service Worker/CacheStorage"
rm -rf "/Users/$USER/Library/Application Support/Slack/Service Worker/ScriptCache"