VSCODE設置文件標籤欄換行

參考來源:https://www.cnblogs.com/zmj97/p/13079622.html

以下原文:

修改方法

1. 安裝Custom CSS and JS Loader插件

2. 添加文件/Users/zmj/.vscode/tabs-wrapper.css

.title {
    height: auto !important;
}

.tabs-and-actions-container {
    display: block !important;
    height: auto !important;
}

.tabs-and-actions-container .monaco-scrollable-element {
    height: auto !important;
}

.tabs-container {
    overflow: initial !important;
    height: auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

.tabs-and-actions-container .editor-actions {
    position: fixed !important;
    right: 0 !important;
    z-index: 20 !important;
    bottom: 20px !important;
    background: #222 !important;
}

3. 在settings.json中添加:

"vscode_custom_css.imports": [
    "file:///Users/zmj/.vscode/tabs-wrapper.css"
],
"vscode_custom_css.policy": true,

4. cmd+shift+p呼出命令框,輸入命令Reload Custom CSS and JS

5. 重啓vscode

6. 完成!

個人補充:

我在linux系統中  .vscode文件夾位於用戶文件夾  /home/kangzenan/.vscode

第三步應該 改爲:

"vscode_custom_css.imports": [
    "file:///home/kangzenan/.vscode/tabs-wrapper.css"
],
"vscode_custom_css.policy": true,

運行第四部的時候VScode出現如下提示

"Run VS Code with admin privileges so the changes can be applied"

解決辦法是輸入命令修改vscode代碼文件夾權限

sudo chown -R $(whoami) <Path to Code>

$(whoami)是環境變量表示你的用戶名,也可以直接輸入用戶名. <Path to Code>表示vscode的路徑(安裝路徑?) 

例如我自己輸入爲

sudo chown -R kangzenan /usr/share/code

其他系統可能vscode的文件夾路徑有所不同, Custom CSS and JS Loader插件文檔中給出了說明:

Windows users

In Windows, make sure you run your VS Code in Administrator mode before enabling or disabling your custom style!

Mac and Linux users

The extension would NOT if Code cannot modify itself. The cases include:

  • Code files being read-only, like on a read-only file system or,
  • Code is not started with the permissions to modify itself.

You need to claim ownership on Code's installation directory, by running this command:

sudo chown -R $(whoami) <Path to Code>

The placeholder <Path to Code> means the path to VSCode installation. It is typically:

  • /Applications/Visual Studio Code.app/Contents/MacOS/Electron, on MacOS;
  • /Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron, on MacOS when using Insiders branch;
  • /usr/share/code, on most Linux;
  • /opt/visual-studio-code/ on Arch Linux.

Mac and Linux package managers may have customized installation path. Please double check your path is correct.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章