요약

  • uv 도입에 맞춰 Cursor(VS Code) 에디터를 최적화하는 settings.json 세팅 가이드
  • .venv 완벽 인식, Code Runner 튜닝, Shift+Enter 매크로 기능까지 적용

1. 기능별 설정

1.1 기본 UI 최적화

  • "workbench.editor.enablePreview": false — 탭 미리보기 모드 비활성화
  • "editor.minimap.enabled": false — 미니맵 off
  • "window.restoreWindows": "none" — 재시작 시 이전 창 복구 안 함
  • "files.exclude".venv, __pycache__ 탐색기에서 숨김

1.2 Git 설정

  • "git.autofetch": true — 원격 변경사항 자동 감지
  • "git.enableSmartCommit": true — 자동 스테이징 후 커밋
  • "git.confirmSync": false — 동기화 팝업 제거

1.3 파이썬 & 가상환경 자동화

  • "python.terminal.activateEnvironment": true.venv 자동 감지 및 활성화
  • "python.createEnvironment.trigger": "off" — 불필요한 환경 생성 알림 차단

1.4 Code Runner 설정

  • "python": "$pythonPath -u".venv 파이썬으로 실행 강제
  • "code-runner.runInTerminal": true — 터미널에서 실행 (input() 오류 방지)
  • "code-runner.ignoreSelection": true — 드래그 무시하고 파일 전체 실행

1.5 매크로: Shift+Enter

  • editor.action.smartSelect.expandpython.execSelectionInTerminalcancelSelectioncursorDown
  • Jupyter처럼 함수 블록 단위 실행 가능

2. 필수 확장 프로그램

Extensions제작자설명
PythonMicrosoft.venv 자동 인식
Macrosctf0매크로 실행
Code RunnerJun Han재생 버튼(▶) 활성화
Github ThemeGithub테마
Indent-Rainbowoderwat들여쓰기 색상

3. 단축키 설정 (keybindings.json)

[
    {
        "key": "shift+enter",
        "command": "python.execSelectionInTerminal",
        "when": "editorTextFocus && editorLangId == 'python'"
    }
]

4. 통합 settings.json

{
    "workbench.editor.enablePreview": false,
    "editor.minimap.enabled": false,
    "window.restoreWindows": "none",
    "files.exclude": {"**/__pycache__": true, "**/.venv": true},
    "files.watcherExclude": {"**/.venv": true},
    "git.autofetch": true,
    "git.enableSmartCommit": true,
    "git.confirmSync": false,
    "python.terminal.activateEnvironment": true,
    "python.createEnvironment.trigger": "off",
    "code-runner.executorMap": {"python": "$pythonPath -u"},
    "code-runner.runInTerminal": true,
    "code-runner.ignoreSelection": true,
    "macros.list": {
        "runBlock": [
            "editor.action.smartSelect.expand",
            "python.execSelectionInTerminal",
            "cancelSelection",
            "cursorDown"
        ]
    },
    "editor.tabSize": 4,
    "editor.fontFamily": "'JetBrains Mono', 'D2Coding', Consolas, monospace",
    "editor.fontLigatures": true,
    "workbench.colorTheme": "GitHub Dark"
}

참고사이트