はじめに
最近、Windows PC を購入しまして、業務では mac, プライベートでは Windows で開発をしています。 どちらも VSCode を使用しているのですが、ショートカットに微妙に差があったりして戸惑うことがちらほらありました。 そこで、そこら辺の際をまるっと把握してしまおうということで OS ごとの初期ショートカットキーを表にまとめたので共有いたします。
注意
初期ショートカットキーは2024年6月時点の下記を参照しています。
なお、この記事では下記pdf以外の初期ショートカットキーは無視します。
- Windows: https://go.microsoft.com/fwlink/?linkid=832145
- macOS: https://go.microsoft.com/fwlink/?linkid=832143
- Linux: https://go.microsoft.com/fwlink/?linkid=832144
また、pdf からの抽出、markdown テーブルへの加工は LLM を利用しています。
そのうえで人手で調整しています。
予めご了承ください。
表
Category | Description | Windows | Mac | Linux |
---|---|---|---|---|
General | Show Command Palette | Ctrl+Shift+P, F1 | ⇧⌘P, F1 | Ctrl+Shift+P, F1 |
General | Quick Open, Go to File… | Ctrl+P | ⌘P | Ctrl+P |
General | New window/instance | Ctrl+Shift+N | ⇧⌘N | Ctrl+Shift+N |
General | Close window/instance | Ctrl+Shift+W | ⌘W | Ctrl+W |
General | User Settings | Ctrl+, | ⌘, | Ctrl+, |
General | Keyboard Shortcuts | Ctrl+K Ctrl+S | ⌘K ⌘S | Ctrl+K Ctrl+S |
Basic editing | Cut line (empty selection) | Ctrl+X | ⌘X | Ctrl+X |
Basic editing | Copy line (empty selection) | Ctrl+C | ⌘C | Ctrl+C |
Basic editing | Move line up/down | Alt+ ↑ / ↓ | ⌥↓ / ⌥↑ | Alt+ ↓ / ↑ |
Basic editing | Copy line up/down | Shift+Alt + ↓ / ↑ | ⇧⌥↓ / ⇧⌥↑ | |
Basic editing | Delete line | Ctrl+Shift+K | ⇧⌘K | Ctrl+Shift+K |
Basic editing | Insert line below / above | Ctrl+Enter / Ctrl+Shift+Enter | ⌘Enter / ⇧⌘Enter | Ctrl+Enter / Ctrl+Shift+Enter |
Basic editing | Jump to matching bracket | Ctrl+Shift+\ | ⇧⌘\ | Ctrl+Shift+\ |
Basic editing | Indent/outdent line | Ctrl+] / [ | ⌘] / ⌘[ | Ctrl+] / Ctrl+[ |
Basic editing | Go to beginning/end of line | Home / End | Home / End | Home / End |
Basic editing | Go to beginning/end of file | Ctrl+Home / Ctrl+End | ⌘↑ / ⌘↓ | Ctrl+ Home / End |
Basic editing | Scroll line up/down | Ctrl+↑ / ↓ | ⌃PgUp / ⌃PgDn | Ctrl+ ↑ / ↓ |
Basic editing | Scroll page up/down | Alt+PgUp / PgDn | ⌘PgUp /⌘PgDn | Alt+ PgUp / PgDn |
Basic editing | Fold/unfold region | Ctrl+Shift+[ / ] | ⌥⌘[ / ⌥⌘] | Ctrl+Shift+ [ / ] |
Basic editing | Fold/unfold all subregions | Ctrl+K Ctrl+[ / ] | ⌘K ⌘[ / ⌘K ⌘] | Ctrl+K Ctrl+ [ / ] |
Basic editing | Fold/unfold all regions | Ctrl+K Ctrl+0 / J | ⌘K ⌘0 / ⌘K ⌘J | Ctrl+K Ctrl+0 / Ctrl+K Ctrl+J |
Basic editing | Add line comment | Ctrl+K Ctrl+C | ⌘K ⌘C | Ctrl+K Ctrl+C |
Basic editing | Remove line comment | Ctrl+K Ctrl+U | ⌘K ⌘U | Ctrl+K Ctrl+U |
Basic editing | Toggle line comment | Ctrl+/ | ⌘/ | Ctrl+/ |
Basic editing | Toggle block comment | Shift+Alt+A | ⇧⌥A | Ctrl+Shift+A |
Basic editing | Toggle word wrap | Alt+Z | ⌥Z | Alt+Z |
Navigation | Show all Symbols | Ctrl+T | ⌘T | Ctrl+T |
Navigation | Go to Line... | Ctrl+G | ⌃G | Ctrl+G |
Navigation | Go to File... | Ctrl+P | ⌘P | Ctrl+P |
Navigation | Go to Symbol... | Ctrl+Shift+O | ⇧⌘O | Ctrl+Shift+O |
Navigation | Show Problems panel | Ctrl+Shift+M | ⇧⌘M | Ctrl+Shift+M |
Navigation | Navigate editor group history | Ctrl+Shift+Tab | ⌃⇧Tab | Ctrl+Shift+Tab |
Navigation | Go back / forward | Alt+ ← / → | ⌃- / ⌃⇧- | Ctrl+Alt+- / Ctrl+Shift+- |
Navigation | Toggle Tab moves focus | Ctrl+M | ⌃⇧M | Ctrl+M |
Navigation | Go to next/previous error or warning | F8 / Shift+F8 | F8 / ⇧F8 | F8 / Shift+F8 |
Search and replace | Find | Ctrl+F | ⌘F | Ctrl+F |
Search and replace | Replace | Ctrl+H | ⌥⌘F | Ctrl+H |
Search and replace | Find next/previous | F3 / Shift+F3 | ⌘G / ⇧⌘G | F3 / Shift+F3 |
Search and replace | Select all occurrences of Find match | Alt+Enter | ⌥Enter | Alt+Enter |
Search and replace | Add selection to next Find match | Ctrl+D | ⌘D | Ctrl+D |
Search and replace | Move last selection to next Find match | Ctrl+K Ctrl+D | ⌘K ⌘D | Ctrl+K Ctrl+D |
Search and replace | Toggle case-sensitive / regex / whole word | Alt+C / R / W | ||
Multi-cursor and selection | Insert cursor | Alt+Click | ⌥ + click | Alt+Click |
Multi-cursor and selection | Insert cursor above / below | Ctrl+Alt+ ↑ / ↓ | ⌥⌘↑ / ⌥⌘↓ | Shift+Alt+ ↑ / ↓ |
Multi-cursor and selection | Undo last cursor operation | Ctrl+U | ⌘U | Ctrl+U |
Multi-cursor and selection | Insert cursor at end of each line selected | Shift+Alt+I | ⇧⌥I | Shift+Alt+I |
Multi-cursor and selection | Select current line | Ctrl+L | ⌘L | Ctrl+L |
Multi-cursor and selection | Select all occurrences of current selection | Ctrl+Shift+L | ⇧⌘L | Ctrl+Shift+L |
Multi-cursor and selection | Select all occurrences of current word | Ctrl+F2 | ⌘F2 | Ctrl+F2 |
Multi-cursor and selection | Expand / shrink selection | Shift+Alt+→ / Shift+Alt+← | ⌃⇧⌘→ / ← | Shift+Alt+→ / Shift+Alt+← |
Multi-cursor and selection | Column (box) selection | Shift+Alt + (drag mouse) | ⇧⌥ + drag mouse | Shift+Alt + drag mouse |
Multi-cursor and selection | Column (box) selection | Ctrl+Shift+Alt + (arrow key) | ⇧⌥ + drag mouse | Shift+Alt + drag mouse |
Multi-cursor and selection | Column (box) selection page up/down | Ctrl+Shift+Alt +PgUp/PgDn | ⇧⌥⌘PgUp / ⇧⌥⌘PgDn | |
Multi-cursor and selection | Column (box) selection up/down | ⇧⌥⌘↑ / ↓ | ||
Multi-cursor and selection | Column (box) selection left/right | ⇧⌥⌘← / → | ||
Rich languages editing | Trigger suggestion | Ctrl+Space, Ctrl+I | ⌃Space, ⌘I | Ctrl+Space, Ctrl+I |
Rich languages editing | Trigger parameter hints | Ctrl+Shift+Space | ⇧⌘Space | Ctrl+Shift+Space |
Rich languages editing | Format document | Shift+Alt+F | ⇧⌥F | Ctrl+Shift+I |
Rich languages editing | Format selection | Ctrl+K Ctrl+F | ⌘K ⌘F | Ctrl+K Ctrl+F |
Rich languages editing | Go to Definition | F12 | F12 | F12 |
Rich languages editing | Peek Definition | Alt+F12 | ⌥F12 | Ctrl+Shift+F10 |
Rich languages editing | Open Definition to the side | Ctrl+K F12 | ⌘K F12 | Ctrl+K F12 |
Rich languages editing | Quick Fix | Ctrl+. | ⌘. | Ctrl+. |
Rich languages editing | Show References | Shift+F12 | ⇧F12 | Shift+F12 |
Rich languages editing | Rename Symbol | F2 | F2 | F2 |
Rich languages editing | Trim trailing whitespace | Ctrl+K Ctrl+X | ⌘K ⌘X | Ctrl+K Ctrl+X |
Rich languages editing | Change file language | Ctrl+K M | ⌘K M | Ctrl+K M |
Editor management | Close editor | Ctrl+F4, Ctrl+W | ⌘W | Ctrl+W |
Editor management | Close folder | Ctrl+K F | ⌘K F | Ctrl+K F |
Editor management | Split editor | Ctrl+\ | ⌘\ | Ctrl+\ |
Editor management | Focus into 1st, 2nd or 3rd editor group | Ctrl+ 1 / 2 / 3 | ⌘1 / ⌘2 / ⌘3 | Ctrl+ 1 / 2 / 3 |
Editor management | Focus into previous/next editor group | Ctrl+K Ctrl+ ←/→ | ⌘K ⌘← / ⌘K ⌘→ | Ctrl+K Ctrl + ← / Ctrl+K Ctrl + → |
Editor management | Move editor left/right | Ctrl+Shift+PgUp / PgDn | ⌘K ⇧⌘← / ⌘K ⇧⌘→ | Ctrl+Shift+PgUp / Ctrl+Shift+PgDn |
Editor management | Move active editor group | Ctrl+K ← / → | ⌘K ← / ⌘K → | Ctrl+K ← / Ctrl+K → |
File management | New File | Ctrl+N | ⌘N | Ctrl+N |
File management | Open File... | Ctrl+O | ⌘O | Ctrl+O |
File management | Save | Ctrl+S | ⌘S | Ctrl+S |
File management | Save As... | Ctrl+Shift+S | ⇧⌘S | Ctrl+Shift+S |
File management | Save All | Ctrl+K S | ⌥⌘S | |
File management | Close | Ctrl+F4 | ⌘W | Ctrl+W |
File management | Close All | Ctrl+K Ctrl+W | ⌘K ⌘W | Ctrl+K Ctrl+W |
File management | Reopen closed editor | Ctrl+Shift+T | ⇧⌘T | Ctrl+Shift+T |
File management | Keep preview mode editor open | Ctrl+K Enter | ⌘K Enter | Ctrl+K Enter |
File management | Copy path of active file | Ctrl+K P | ⌘K P | Ctrl+K P |
File management | Reveal active file in Explorer | Ctrl+K R | Ctrl+K R | |
File management | Reveal active file in Finder | ⌘K R | ||
File management | Show active file in new window/instance | Ctrl+K O | ⌘K O | Ctrl+K O |
File management | Open next / previous | Ctrl+Tab / Ctrl+Shift+Tab | ⌃Tab / ⌃⇧Tab | Ctrl+Tab / Ctrl+Shift+Tab |
Display | Toggle full screen | F11 | ⌃⌘F | F11 |
Display | Toggle editor layout (horizontal/vertical) | Shift+Alt+0 | ⌥⌘0 | Shift+Alt+0 |
Display | Zoom in/out | Ctrl+ = / - | ⌘= / ⇧⌘- | Ctrl+ = / - |
Display | Toggle Sidebar visibility | Ctrl+B | ⌘B | Ctrl+B |
Display | Show Explorer / Toggle focus | Ctrl+Shift+E | ⇧⌘E | Ctrl+Shift+E |
Display | Show Search | Ctrl+Shift+F | ⇧⌘F | Ctrl+Shift+F |
Display | Show Source Control | Ctrl+Shift+G | ⌃⇧G | Ctrl+Shift+G |
Display | Show Debug | Ctrl+Shift+D | ⇧⌘D | Ctrl+Shift+D |
Display | Show Extensions | Ctrl+Shift+X | ⇧⌘X | Ctrl+Shift+X |
Display | Replace in files | Ctrl+Shift+H | ⇧⌘H | Ctrl+Shift+H |
Display | Toggle Search details | Ctrl+Shift+J | ⇧⌘J | Ctrl+Shift+J |
Display | Show Output panel | Ctrl+Shift+U | ⇧⌘U | Ctrl+K Ctrl+H |
Display | Open Markdown preview | Ctrl+Shift+V | ⇧⌘V | Ctrl+Shift+V |
Display | Open Markdown preview to the side | Ctrl+K V | ⌘K V | Ctrl+K V |
Display | Zen Mode (Esc Esc to exit) | Ctrl+K Z | ⌘K Z | Ctrl+K Z |
Display | Open new command prompt/terminal | Ctrl+Shift+C | ||
Debug | Toggle breakpoint | F9 | F9 | F9 |
Debug | Start/Continue | F5 | F5 | F5 |
Debug | Stop | Shift+F5 | ⇧F5 | Shift+F5 |
Debug | Step into/out | F11 / Shift+F11 | F11 / ⇧F11 | F11 / Shift+F11 |
Debug | Step over | F10 | F10 | F10 |
Debug | Show hover | Ctrl+K Ctrl+I | ⌘K ⌘I | Ctrl+K Ctrl+I |
Integrated terminal | Show integrated terminal | Ctrl+` | ⌃` | Ctrl+` |
Integrated terminal | Create new terminal | Ctrl+Shift+` | ⌃⇧` | Ctrl+Shift+` |
Integrated terminal | Copy selection | Ctrl+C | ⌘C | Ctrl+Shift+C |
Integrated terminal | Paste into active terminal | Ctrl+V | Ctrl+Shift+V | |
Integrated terminal | Scroll up/down | Ctrl+↑ / ↓ | ⌘↑ / ↓ | Ctrl+Shift+ ↑ / ↓ |
Integrated terminal | Scroll page up/down | Shift+PgUp / PgDn | PgUp / PgDn | Shift+ PgUp / PgDn |
Integrated terminal | Scroll to top/bottom | Ctrl+Home / End | ⌘Home / End | Shift+ Home / End |
おわりに
思ったより差がなくてびっくりしてます。 mac での行頭、行末への移動が Windows では見当たらなくてこの表を作ろうと思ったのですがあれは VSCode ではなく OS の挙動なのか...
気が向けば日本語版にして再度アップしようと思います。