[ต้องรู้] รวมคีย์ลัด VS Code ให้คุณโค้ดไวขึ้น (ขั้นเทพ)

Editor ที่เป็นที่นิยมในการเขียนโค้ดในปัจจุบันหนึ่งในนั้นคือ VS Code เพราะเป็นทั้งFreewareและยังรองรับ Extension ที่หลากหลาย ทำให้การการเขียนโค้ดสะดวกขึ้นอย่างมาก ซึ่งในวันนี้เราจะมาดูคีย์ลัดในโปรแกรมที่จะยิ่งทำให้เราทำงานได้อย่างง่าย และสะดวกรวดเร็วขึ้นกันครับ 🙂 🙂 🙂

หมายเหตุ : ความหมายของสัญลักษณ์สำหรับเครื่อง Mac ในบทความนี้ครับ


CommandWindowMac
ปิดหน้าต่างเขียนโค้ดปัจจุบันCtrl+W⌘W
เปิดแท็บที่เพิ่งปิดขึ้นมาใหม่Ctrl+Shift+T⌘T
เปิดไฟล์(เรียงตามไฟล์ล่าสุดที่เปิด)Ctrl+P⌘P
สลับแท็บไฟล์ที่ทำงานCtrl+Tab⌃⇧Tab
เลื่อนแท็บปัจจุบันมาฝั่งซ้ายCtrl+Shift+PageUp⌘K ⇧⌘←
เลื่อนแท็บปัจจุบันมาฝั่งซ้ายCtrl+Shift+PageDown⌘K ⇧⌘→
เพิ่มหน้าต่างเขียนโค้ดCtrl+\⌘\
เลือกหน้าต่างเขียนโค้ดที่1Ctrl+2⌘1
เลือกหน้าต่างเขียนโค้ดที่2Ctrl+2⌘2
เพิ่มบรรทัด(ล่าง) โดยCursorอยู่ตรงไหนก็ได้Ctrl+Enter⌘Enter
เพิ่มบรรทัด(บน) โดยCursorอยู่ตรงไหนก็ได้Shift+Ctrl+Enter⇧⌘Enter
เลื่อนบรรทัดปัจจุบันขึ้นไป1บรรทัดAlt+Up⌥↑
เลื่อนบรรทัดปัจจุบันลง1บรรทัดAlt+Down⌥↓
Copyโค้ดบรรทัดปัจจุบันไปวางบรรทัดบนShift+Alt+Up⇧⌥↑
Copyโค้ดบรรทัดปัจจุบันแล้ววางที่บรรทัดล่างShift+Alt+Down⇧⌥↓
เลือกทั้งแถวCtrl+L⌘L
เพิ่มแท็บที่บรรทัดปัจจุบันCtrl+]⌘]
ลดแท็บที่บรรทัดปัจจุบันCtrl+[⌘[
ลบบรรทัดปัจจุบัน(Cursorอยู่ตรงไหนก็ได้)Ctrl+X⌘X
ไปที่บรรทัดบนสุดCtrl+Home⌘Home
ไปที่บรรทัดล่างสุดCtrl+End⌘End
คอมเมนต์Ctrl+/⌘/
แสดงคำแนะนำการเขียนโค้ดCtrl+Space^Space
ดูว่าตัวแปร/ฟังก์ชันนี้ถูกเรียกที่ไหนบ้างF12F12
ย่อฟังก์ชันให้สั้นCtrl+Shift+[⌥⌘[
เลิกย่อฟังก์ชันCtrl+Shift+]⌥⌘]
ไปที่บรรทัดที่(กรอก)Ctrl+G^G
ย้อนกลับไปตำแหน่งCursorก่อนหน้าAlt+Left⌃-
ไปยังCursorถัดไปAlt+Right⌃⇧-
แสดงโค้ดให้พอดีกับหน้าจอ (ไม่กระทบFormat)Alt+Z⌥Z
ซูมหน้าจอเข้าCtrl+=⌘=
ซูมหน้าจอออกCtrl+-⇧⌘-
จัดรูปแบบโค้ดอัตโนมัติ(มาตรฐานPEP8)Shift+Alt+F⇧⌥F
เพิ่มCursor(กรณีต้องการเพิ่มค่าเดียวกันหลายจุด)Alt+คลิกตำแหน่ง⌥+คลิกตำแหน่ง
เปิดVS Codeใหม่Ctrl+Shift+N⇧⌘N
ลบ(กลุ่ม)คำด้านซ้ายCtrl+Backspace⌘Backspace
ลบ(กลุ่ม)คำด้านขวาCtrl+Del⌘Del
เลื่อนหน้าจอขึ้นCtrl+Up⌃PgUp
เลื่อนหน้าจอลงCtrl+Down⌃PgDn
เลื่อนหน้าจอขึ้น1หน้าAlt+PageUp⌘PgUp
เลื่อนหน้าจอลง1หน้าAlt+PageDown⌘PgDn
เพิ่มบล็อกคอมเมนต์ (“”” “””)Shift+Alt+A⇧⌥A
แทนที่Ctrl+H⌥⌘F
แสดงพารามิเตอร์ที่ฟังก์ชันต้องการCtrl+Shift+Space⇧⌘Space
โหมดเต็มหน้าจอF11⌃⌘F
ซ่อน/แสดงแท็บด้านข้างCtrl+B⌘B
สลับCursorระหว่างExploreกับพื้นที่เขียนโค้ดCtrl+Shift+E⇧⌘E
ซ่อน/แสดง OutputCtrl+Shift+U⇧⌘U
เปิดหน้าต่างCommand PromptCtrl+Shift+C
เปิดหน้าต่าง SettingCtrl+,⌘,

Source : VSCode Keybindings

51 thoughts on “[ต้องรู้] รวมคีย์ลัด VS Code ให้คุณโค้ดไวขึ้น (ขั้นเทพ)

  1. tinyurl.com says:

    Woah! I’m really digging the template/theme of this blog.

    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between user friendliness and visual appeal.
    I must say you’ve done a great job with this. Also, the blog
    loads super quick for me on Opera. Excellent Blog!

  2. http://tinyurl.com/y9zq4bc6 says:

    Hi there terrific website! Does running a blog similar to this
    require a great deal of work? I’ve very little understanding
    of coding however I was hoping to start my own blog soon. Anyways, should you have any recommendations or techniques for new blog owners please share.
    I understand this is off topic however I simply wanted to ask.
    Thank you!

  3. zoritoler imol says:

    What i do not realize is in reality how you are now not actually a lot more well-favored than you may be right now. You’re so intelligent. You already know thus significantly relating to this subject, made me in my view believe it from so many varied angles. Its like women and men don’t seem to be fascinated unless it¦s something to do with Woman gaga! Your individual stuffs great. All the time take care of it up!

  4. graliontorile says:

    I have been browsing online greater than three hours as of late, yet I by no means found any attention-grabbing article like yours. It’s pretty price enough for me. Personally, if all website owners and bloggers made just right content as you did, the net might be much more helpful than ever before.

  5. zorivare worilon says:

    Thank you for sharing superb informations. Your web-site is very cool. I’m impressed by the details that you have on this website. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for extra articles. You, my friend, ROCK! I found simply the info I already searched all over the place and just could not come across. What a perfect web site.

  6. Szöszy Szalon fodrász Miskolc says:

    hello there and thank you for your information – I have definitely picked up anything new from right here. I did however expertise a few technical points using this site, since I experienced to reload the web site many times previous to I could get it to load correctly. I had been wondering if your hosting is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and can damage your quality score if ads and marketing with Adwords. Well I am adding this RSS to my email and could look out for a lot more of your respective intriguing content. Ensure that you update this again soon..

ใส่ความเห็น

อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องข้อมูลจำเป็นถูกทำเครื่องหมาย *