目錄
How to Split the Editor
Working with Multiple Editor Groups
Resize and Navigate Between Splits
Close and Manage Splits
首頁 開發工具 VSCode 如何在VSCODE中使用拆分編輯器功能

如何在VSCODE中使用拆分編輯器功能

Aug 16, 2025 am 10:48 AM
vscode 分屏编辑

使用拖拽標籤、右鍵菜單、快捷鍵(如Ctrl \)或命令面板可拆分編輯器;2. 拆分後可形成垂直、水平或網格佈局的編輯組;3. 通過拖動標籤或使用快捷鍵(如Ctrl 1/2/3)在組間切換;4. 可調整分割大小、在窗格間移動文件並跨分割導航錯誤;5. 通過關閉標籤、使用右鍵菜單或“Join All Editors”命令管理並合併分割;6. 可在設置中配置自動側邊打開文件的行為;分割編輯器功能靈活,適用於代碼對比、編寫和重構,且能無縫集成到工作流中。

How to use the split editor feature in VSCode

The split editor feature in Visual Studio Code (VSCode) lets you view and edit multiple files—or different parts of the same file—side by side. This is especially useful when comparing code, copying logic between files, or working on related functions. Here's how to use it effectively.

How to Split the Editor

You can split the editor window in several ways:

  • Drag and drop a tab : Click and drag a file tab to the side, top, or bottom of the editor area. A visual guide will show where the split will appear.
  • Right-click a tab or file in Explorer : Open the context menu and choose Split Editor , Split Editor Right , Split Editor Down , or similar options.
  • Use keyboard shortcuts :
    • Ctrl \ (or Cmd \ on Mac) – Splits the current editor vertically.
    • Ctrl 1 / Ctrl 2 / Ctrl 3 – Switch between editor groups (1 = first, 2 = second, etc.).
    • Ctrl Alt ↓ or Ctrl Alt → – Move between editor groups.
  • Command Palette : Press Ctrl Shift P , type “split”, and choose from options like Split Editor Right or Split Editor Below .

Working with Multiple Editor Groups

Once you've split the editor, you're working with separate editor groups. These can be arranged in various layouts:

  • Vertical split – Most common for comparing code side by side.
  • Horizontal split – Useful when you want to see different sections of a long file (eg, header and implementation).
  • Grid layout – You can create a 2x2 grid or other combinations by splitting multiple times in different directions.

To move files between groups:

  • Drag a tab from one group to another.
  • Right-click a tab and choose Move Editor to Left/Right/Up/Down .
  • Use Ctrl Shift Alt → (or arrow key) to move the active editor group in that direction.

Resize and Navigate Between Splits

  • Hover over the divider between splits and drag to resize.
  • Click inside any editor pane to focus it.
  • Use Ctrl Tab to cycle through open files across all groups.
  • Press F8 to jump between errors, even across split views.

You can also set VSCode to automatically split editors when opening multiple files:

  • Go to Settings ( Ctrl , ), search for “editor: open side by side”.
  • Enable Workbench › Editor › Enable Preview and adjust Open Next to Editor settings if needed.

Close and Manage Splits

  • To close a single split, click the × on the tab or press Ctrl W .
  • To close all but the current editor, right-click the tab and choose Close Others .
  • To remove an entire editor group, hover over the tab bar and click the × on the group header.

You can also use the Join All Editors command in the Command Palette to collapse all splits into one.

Basically, the split editor is flexible and integrates smoothly into your workflow—whether you're reviewing, writing, or refactoring code.

以上是如何在VSCODE中使用拆分編輯器功能的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Stock Market GPT

Stock Market GPT

人工智慧支援投資研究,做出更明智的決策

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

如何在VSCODE中自動格式化Python代碼 如何在VSCODE中自動格式化Python代碼 Aug 14, 2025 pm 04:10 PM

toAutomation formatemationalformatpytpythoncodeinvscode,installblackusingpipinstallblack,installtheofficialmicrosoftpythonextension,setblackastheformatterinsettings.jsonwith“ python.formatting.formatting.provider”

如何在VSCODE中調試Perl腳本 如何在VSCODE中調試Perl腳本 Aug 23, 2025 am 06:23 AM

Yes,debuggingaPerlscriptinVSCodeispossibleusingthePerlDebugAdapterandPerlLanguageServerdespitelackingnativesupport.First,ensurePerlisinstalledandverifywithperl-v,theninstallthePerl::LanguageServermoduleviacpanPerl::LanguageServerorcpanmPerl::Language

如何在VScode中調試Python腳本 如何在VScode中調試Python腳本 Aug 16, 2025 am 02:53 AM

要調試Python腳本,需先安裝Python擴展並配置解釋器,然後創建launch.json文件設置調試配置,接著在代碼中設置斷點並按F5啟動調試,腳本將在斷點處暫停,允許檢查變量和單步執行,最終通過查看控制台輸出、添加日誌或調整參數等方式排查問題,確保環境正確後調試過程簡單高效。

如何在VSCODE中調試Scala應用程序 如何在VSCODE中調試Scala應用程序 Aug 21, 2025 pm 03:36 PM

是的,VSCode通過Metals擴展可以調試Scala應用,首先安裝Metals擴展並導入Scala項目,確保啟用調試適配器並在設置中開啟metals.enable-debugging-features,然後在main方法或測試中設置斷點,通過F5或代碼透鏡的“Debug”選項啟動調試,可配合launch.json配置調試參數,支持本地運行和遠程JVM附加調試,調試時注意確保代碼被執行且構建已成功導入,最終實現類似其他IDE的變量檢查和單步執行功能。

如何在VScode中調試Rust程序 如何在VScode中調試Rust程序 Aug 22, 2025 am 09:33 AM

是的,VSCode可以調試Rust程序,但需要安裝rust-analyzer、CodeLLDB擴展及lldb或gdb調試器,配置launch.json並設置斷點後即可通過F5啟動調試,檢查變量、單步執行和評估表達式,儘管不如JavaScript等語言便捷,但通過正確配置可實現高效調試。

如何在VSCODE中使用'轉到定義”功能? 如何在VSCODE中使用'轉到定義”功能? Aug 08, 2025 pm 02:59 PM

UseCtrl click(Cmd clickonmacOS)onasymboltogodirectlytoitsdefinition.2.PressF12withthecursoronthesymboltonavigatetoitsdefinition,oruseCtrl Shift F12topreviewitinapeekwindow.3.Right-clickthesymbolandselect"GotoDefinition"or"PeekDefinitio

如何在VSCODE中使用拆分編輯器功能 如何在VSCODE中使用拆分編輯器功能 Aug 16, 2025 am 10:48 AM

使用拖拽標籤、右鍵菜單、快捷鍵(如Ctrl \)或命令面板可拆分編輯器;2.拆分後可形成垂直、水平或網格佈局的編輯組;3.通過拖動標籤或使用快捷鍵(如Ctrl 1/2/3)在組間切換;4.可調整分割大小、在窗格間移動文件並跨分割導航錯誤;5.通過關閉標籤、使用右鍵菜單或“JoinAllEditors”命令管理並合併分割;6.可在設置中配置自動側邊打開文件的行為;分割編輯器功能靈活,適用於代碼對比、編寫和重構,且能無縫集成到工作流中。

如何在VSCODE中連接到遠程服務器? 如何在VSCODE中連接到遠程服務器? Aug 12, 2025 am 01:49 AM

安裝Remote-SSH擴展;2.配置本地SSH訪問並推薦使用SSH密鑰;3.通過命令面板輸入主機信息或使用~/.ssh/config文件連接;4.連接後在遠程服務器上打開文件夾即可編輯,VSCode會自動安裝遠程擴展並提供完整開發功能,連接前需確保SSH服務正常、防火牆允許端口且密鑰權限正確,最終實現與本地開發幾乎一致的遠程開發體驗。

See all articles