Skip to content
← All Skills
🖱️

Cursor

AI-powered code editor — ใช้ AI ช่วยเขียน code, refactor, debug ได้เร็วขึ้น

What I Can Do

  • ใช้ AI-assisted code completion เพิ่มความเร็วในการเขียน code
  • Chat with codebase เพื่อเข้าใจ code ที่ไม่คุ้นเคย
  • ใช้ inline edits สำหรับ refactoring
  • ตั้งค่า .cursorrules สำหรับ project-specific AI behavior
  • ใช้ multi-file editing สำหรับ cross-cutting changes

Shortcuts I Use Daily

text
# AI chat (ถาม questions เกี่ยวกับ code)
Cmd + L

# Inline edit (แก้ code ตรง selection)
Cmd + K

# Accept AI suggestion
Tab

# Open command palette
Cmd + Shift + P

# Quick file open
Cmd + P

# Search across files
Cmd + Shift + F

# Toggle terminal
Cmd + `

AI Code Completion

Cursor ให้ AI suggestions ขณะพิมพ์ — ไม่ใช่แค่ autocomplete syntax แต่เข้าใจ context ของ codebase ทำให้ suggest ได้ตรง patterns ของ project กด Tab accept, Esc reject

Chat with Codebase

Chat panel สามารถ reference files, functions, errors — ถาม "อธิบาย function นี้", "ทำไม test fail", "เขียน unit test ให้ function นี้" AI เข้าถึง codebase context ทำให้ตอบได้ตรงประเด็น

Inline Edits (Cmd+K)

Select code แล้วกด Cmd+K — พิมพ์สิ่งที่ต้องการแก้ เช่น "add error handling", "convert to TypeScript", "optimize this query" AI แก้ code ตรงจุดโดยไม่ต้องออกจาก editor

Multi-file Editing

AI สามารถแก้หลายไฟล์พร้อมกัน — ใช้สำหรับ refactoring ที่ affect หลาย files เช่น rename interface, add new field ที่ต้อง update ทั้ง type, component, API

.cursorrules Configuration

.cursorrules ไฟล์ที่ root ของ project — define rules สำหรับ AI เช่น coding conventions, preferred patterns, tech stack context ทำให้ AI suggestions ตรงกับ project standards

text
You are working on a Next.js 15 project with:
- TypeScript strict mode
- Tailwind CSS v4
- App Router (not Pages Router)
- Server Components by default

Prefer:
- Functional components
- Named exports
- Explicit return types

Composer (Agent Mode)

Agent mode ให้ Cursor plan และ implement changes ข้าม files อัตโนมัติ — describe สิ่งที่ต้องการแล้ว AI จะ create/edit files, run commands, iterate จนเสร็จ

Model Selection

เลือก AI model ที่ใช้ได้ — Claude, GPT-4, etc. แต่ละ model มีจุดแข็งต่างกัน เลือกตามงาน

Context Management

  • @file — reference specific file
  • @folder — reference entire directory
  • @web — search web for context
  • @docs — reference documentation
  • ยิ่งให้ context ที่ตรง AI ยิ่งตอบได้ดี

Related Skills

  • Claude Code — AI coding assistant อีกตัว
  • Git — version control สำหรับ code changes
  • TypeScript — language ที่ใช้บ่อยใน Cursor