Program Tip

항상 새 탭에서 파일 열기

programtip 2020. 9. 27. 13:47
반응형

항상 새 탭에서 파일 열기


새로 도입 된 탭과 함께 Visual Studio Code 1.3.1을 사용하고 있습니다.

파일을 클릭하면 첫 번째 파일이 탭에서 열립니다. 이 파일을 변경하지 않으면 두 번째로 클릭 한 파일이 동일한 탭에서 열립니다.

이를 방지하고 Visual Studio Code에서 항상 새 탭을 열도록하려면 어떻게해야합니까?


왼쪽 사이드 바의 파일 브라우저에서 파일을 [한 번] 클릭하거나 빠른 열기 메뉴에서 열면 ( Ctrl- P, 파일 이름 입력, Enter) Visual Studio Code는 "미리보기 모드" 에서 파일을 엽니 다. 빠르게 파일을 볼 수 있습니다.

미리보기 모드 탭은 열린 상태로 유지되지 않습니다. 사이드 바에서 다른 파일을 열면 바로 기존 미리보기 모드 탭 (있는 경우)이 사용됩니다. 탭 표시 줄에서 제목을 확인하여 탭이 미리보기 모드인지 확인할 수 있습니다. 제목이 기울임 꼴 이면 탭은 미리보기 모드입니다.

편집 할 파일을 열려면 (예 : 미리보기 모드에서 열지 않음) 사이드 바에서 파일을 두 번 클릭하거나 사이드 바에서 파일을 한 번 클릭 한 다음 미리보기 모드 탭의 제목을 두 번 클릭합니다.

미리보기 모드를 모두 비활성화하려면 "workbench.editor.enablePreview": false설정 파일에서 설정하면됩니다. "workbench.editor.enablePreviewFromQuickOpen"옵션을 사용하여 빠른 열기 메뉴에서만 비활성화 할 수도 있습니다 .

미리보기 모드를 사용 중지하기 전에 설정 파일 을 열어야합니다 .

프로 팁 : 명령 팔레트 를 사용하여 설정 파일을 열 수 있습니다. " Preferences: Open User Settings" 만 입력하면됩니다 !

당신이 (당신의 설정 파일을 연 후에는 사용자의 설정 파일이 오른쪽에 위치해야합니다), 추가 "workbench.editor.enablePreview"속성을, 그리고 그것의 값을 설정합니다 false.

여기 에서 Visual Studio Code의 "미리보기 모드"에 대해 자세히 알아볼 수 있습니다 .


미리보기 모드 를 비활성화하지 않으려면 특정 탭을 열어 두도록 명시 적으로 vscode에 지시 할 수 있습니다 . 위에서 언급했듯이 기울임 꼴 텍스트가있는 탭 제목은 미리보기 모드에 있습니다.

미리보기 모드 에서 탭을 가져 오려면 탭을 마우스 오른쪽 버튼으로 클릭 하고 명령에 매핑 된 keep open단축키 cmd+ k enter선택 하거나 사용할 수 있습니다.workbench.action.keepEditor


동일한 문제가 발생하고 setting.json 파일을 열고 다음을 추가하십시오.

"workbench.editor.enablePreview": false

사용 workbench.editor.enablePreview: false을 완전히 비활성화 미리보기 모드로.

를 사용하여 workbench.editor.enablePreviewFromQuickOpen: false파일에 대한 해제 미리보기 모드로 빠른 개방 메뉴에서 엽니 다.


미리보기 모드 를 사용 중지하고 싶지 않은 사람을위한 것 입니다.

전체 주석을 읽었을 때 빠른 열기 / Ctrl + P 에서 열린 파일을 고정하는 바로 가기 키 또는 열린 파일을 편집기에 유지하는 것을 의미하는 것이 선호하는 것을 찾았습니다. 를 들어도 전환 할 필요가 없습니다. 파일 목록을 두 번 클릭하려면 마우스를 손으로 가져갑니다.

@jontem과 @MattLBeck에게 감사드립니다.

( )를 사용하여 save명령을 호출 하는 것이 내가 선호하는 항목에 도달하는 가장 쉬운 방법입니다.Ctrl+Scmd+s

그리고이 방법을 사용하여 열린 파일을 편집기에 자주 유지한다는 것을 알게된다면, 예, 옵션을 설정 "workbench.editor.enablePreview": false하거나 "workbench.editor.enablePreviewFromQuickOpen": false이전에 언급 한 다른 사람들 같이 설정하는 것이 좋습니다 .


⚡ 사실, VSCode는 파일 미리보기를 보여줍니다.

다음과 같이 미리보기를 비활성화 할 수 있습니다.

"workbench.editor.enablePreview": false,

⬇️ 기본적으로이 두 가지 설정을 추가하기 만하면됩니다.

VSCode 팁


Watch for filename in italic

Note that, the file name on the tab is formatted in italic if it has been opened in Preview Mode.

Quickly take a file out of Preview Mode

To keep the file always available in VSCode editor (that is, to take it out of Preview Mode into normal mode), you can double-click on the tab. Then, you will notice the name becomes non-italic.

Feature or bug?

I believe Preview Mode is helpful especially when you have limited screen space and need to check many files.


Menu FilePreferencesUser Settings: add this line "workbench.editor.enablePreviewFromQuickOpen": false


Open in new Tab Solution:

  1. Open the command palette by: Cmd + Shift + K
  2. Open settings file by: Preferences: Open Settings (JSON)
  3. Under user setting, enable Tabs by: "workbench.editor.showTabs": true

Essentially, there are three settings that one has to update (Preference >> settings):

  • workbench.editor.enablePreview: set this to globally enable or disable preview editors

  • workbench.editor.enablePreviewFromQuickOpen: set this to enable or disable preview editors when opened from Quick Open

  • workbench.editor.showTabs: finally one will need to set this
    otherwise, there will be no tabs displayed and you will just be
    wondering why setting/unsetting the above two did not work


You can do it via GUI

여기에 이미지 설명 입력

Search for preview

여기에 이미지 설명 입력

uncheck the options Enable Preview and Enable Preview from Quick Open


As hktang above indicates:

one Click opens the file in preview mode (header text in italics)

Double click the same file, it goes out of preview-mode (header text changes from italic to normal font)

I think this is a "comprimise" feature allowing users, to "navigate" both worlds; preview and none-preview.

  • All you do is click the file to open it in the right panel.
  • Then immediately double click it to keep it there.
  • Or - just treble click. File opens in none preview mode.

HTH Paul S.


In my case, I also had to set workbench.editor.showTabs property to true (in addition to workbench.editor.enablePreview)

I'm not sure how it got changed to false. Maybe, I've accidentally set it to false using some shortcut.


This is so confusing. All developers I asked didn't appreciate this default behavior.

cmd + P프로젝트 파일을 여는 데 사용 합니다.


한 가지 간단한 해결책은 vscode 설정을 변경하는 대신 참조를 통해 파일을 열 때마다 파일이 미리보기 모드 (파일 이름이 기울임 꼴)에 있고 사이드 바에 포커스가있는 동일한 미리보기 파일을 두 번 탭하면 탭에 고정되어 미리보기 모드에서 다른 파일로 대체되지 않습니다.


GUI를 사용하여 활성화

이동 File -> Preferences -> Settings -> User -> Window -> New Window

여기 드롭 다운 목록에서 새 창 에서 파일 열기를 선택합니다.

내 VS Code 버전 1.38.1

참고 URL : https://stackoverflow.com/questions/38713405/open-files-always-in-a-new-tab

반응형