DEV Community

David Nguyen
David Nguyen

Posted on • Originally published at eplus.dev on

Phím tắt VSCode / VSCode Shortcuts

(English below)*

Dưới đây là một số phím tắt phổ biến trong Visual Studio Code (VSCode):

  1. Các phím tắt chung:
  • Ctrl + S: Lưu tệp tin.

  • Ctrl + C: Sao chép.

  • Ctrl + X: Cắt.

  • Ctrl + V: Dán.

  • Ctrl + Z: Hoàn tác.

  • Ctrl + Y: Làm lại.

  • Ctrl + F: Tìm kiếm trong tệp tin hiện tại.

  • Ctrl + H: Tìm kiếm và thay thế trong tệp tin hiện tại.

  • Ctrl + G: Đi đến số dòng cụ thể.

  • Ctrl + P: Mở hộp thoại Quick Open để tìm kiếm tệp tin.

  • Ctrl + Shift + P: Mở hộp thoại Command Palette.

  • Ctrl + Shift + N: Mở cửa sổ mới.

  • Ctrl + Shift + W: Đóng cửa sổ hiện tại.

  1. Các phím tắt quản lý tệp tin:
  • Ctrl + N: Tạo tệp tin mới.

  • Ctrl + O: Mở tệp tin.

  • Ctrl + W: Đóng tệp tin.

  • Ctrl + Tab: Chuyển đổi giữa các tệp tin đang mở.

  1. Các phím tắt chỉnh sửa mã nguồn:
  • Ctrl + D: Mở rộng chọn vùng giống nhau.

  • Ctrl + L: Chọn dòng hiện tại.

  • Ctrl + /: Chú thích/dỡ chú thích dòng.

  • Tab: Thụt vào dòng hiện tại (hoặc vùng đã chọn).

  • Shift + Tab: Thụt ra dòng hiện tại (hoặc vùng đã chọn).

  • Alt + Up/Down: Di chuyển dòng lên/xuống.

Dưới đây là một số phím tắt phổ biến trong Visual Studio Code (VSCode) trên macOS:

  1. Các phím tắt chung:
  • Cmd + S: Lưu tệp tin.

  • Cmd + C: Sao chép.

  • Cmd + X: Cắt.

  • Cmd + V: Dán.

  • Cmd + Z: Hoàn tác.

  • Cmd + Y: Làm lại.

  • Cmd + F: Tìm kiếm trong tệp tin hiện tại.

  • Cmd + H: Tìm kiếm và thay thế trong tệp tin hiện tại.

  • Cmd + G: Đi đến số dòng cụ thể.

  • Cmd + P: Mở hộp thoại Quick Open để tìm kiếm tệp tin.

  • Cmd + Shift + P: Mở hộp thoại Command Palette.

  • Cmd + Shift + N: Mở cửa sổ mới.

  • Cmd + Shift + W: Đóng cửa sổ hiện tại.

  1. Các phím tắt quản lý tệp tin:
  • Cmd + N: Tạo tệp tin mới.

  • Cmd + O: Mở tệp tin.

  • Cmd + W: Đóng tệp tin.

  • Cmd + Tab: Chuyển đổi giữa các tệp tin đang mở.

  1. Các phím tắt chỉnh sửa mã nguồn:
  • Cmd + D: Mở rộng chọn vùng giống nhau.

  • Cmd + L: Chọn dòng hiện tại.

  • Cmd + /: Chú thích/dỡ chú thích dòng.

  • Tab: Thụt vào dòng hiện tại (hoặc vùng đã chọn).

  • Shift + Tab: Thụt ra dòng hiện tại (hoặc vùng đã chọn).

  • Option + Up/Down: Di chuyển dòng lên/xuống.

Đây chỉ là một số phím tắt phổ biến, VSCode cung cấp rất nhiều phím tắt khác và bạn cũng có thể tùy chỉnh phím tắt theo sở thích của mình. Để xem danh sách đầy đủ các phím tắt trong VSCode, bạn có thể truy cập vào menu "File" > "Preferences" > "Keyboard Shortcuts" hoặc sử dụng phím tắt Ctrl + K Ctrl + S.


Here are some common shortcuts in Visual Studio Code (VSCode) on Windows:

  1. General shortcuts:
  • Ctrl + S: Save the file.

  • Ctrl + C: Copy.

  • Ctrl + X: Cut.

  • Ctrl + V: Paste.

  • Ctrl + Z: Undo.

  • Ctrl + Y: Redo.

  • Ctrl + F: Find in the current file.

  • Ctrl + H: Find and replace in an existing file.

  • Ctrl + G: Go to a specific line number.

  • Ctrl + P: Open Quick Open dialog to search for files.

  • Ctrl + Shift + P: Open Command Palette.

  • Ctrl + Shift + N: Open a new window.

  • Ctrl + Shift + W: Close the current window.

  1. File management shortcuts:
  • Ctrl + N: Create a new file.

  • Ctrl + O: Open a file.

  • Ctrl + W: Close a file.

  • Ctrl + Tab: Switch between open files.

  1. Source code editing shortcuts:
  • Ctrl + D: Expand selection to the next matching occurrence.

  • Ctrl + L: Select the current line.

  • Ctrl + /: Comment/uncomment the current line.

  • Tab: Indent the current line (or selected block).

  • Shift + Tab: Outdent the current line (or block chosen).

  • Alt + Up/Down: Move the line up/down.

Here are some common shortcuts in Visual Studio Code (VSCode) on macOS:

  • General shortcuts:

  • Cmd + S: Save the file.

  • Cmd + C: Copy.

  • Cmd + X: Cut.

  • Cmd + V: Paste.

  • Cmd + Z: Undo.

  • Cmd + Y: Redo.

  • Cmd + F: Find in the current file.

  • Cmd + H: Find and replace in the existing file.

  • Cmd + G: Go to a specific line number.

  • Cmd + P: Open Quick Open dialog to search for files.

  • Cmd + Shift + P: Open Command Palette.

  • Cmd + Shift + N: Open a new window.

  • Cmd + Shift + W: Close the current window.

  1. File management shortcuts:
  • Cmd + N: Create a new file.

  • Cmd + O: Open a file.

  • Cmd + W: Close a file.

  • Cmd + Tab: Switch between open files.

  1. Source code editing shortcuts:
  • Cmd + D: Expand selection to the next matching occurrence.

  • Cmd + L: Select the current line.

  • Cmd + /: Comment/uncomment the current line.

  • Tab: Indent the current line (or selected block).

  • Shift + Tab: Outdent the current line (or block chosen).

  • Option + Up/Down: Move the line up/down.

These are just some common shortcuts, and VSCode provides many more shortcuts. You can also customize shortcuts according to your preference. To view the complete list of shortcuts in VSCode, you can go to the "File" menu, select "Preferences," and then "Keyboard Shortcuts," or use the shortcut Cmd + K Cmd + S.

Top comments (0)