This is a simple Visual Studio Code extension that adds a command to toggle the pinning of editor tabs.
keybindings.json
:
{
"key": "ctrl+p",
"command": "workbench.action.unpinEditor",
"when": "activeEditorIsPinned"
},
{
"key": "ctrl+p",
"command": "workbench.action.pinEditor",
"when": "!activeEditorIsPinned"
}
- Toggle pinning/unpinning of the active editor tab.
- Easily manage pinned tabs using a custom keyboard shortcut.
-
Open a file in Visual Studio Code.
-
Use the registered command to toggle the pinning of the active editor tab. The extension does not automatically detect keyboard shortcuts.
To use the command, you can:
- Open the command palette by pressing
Ctrl+Shift+P
, then type "Open Keyboard Shortcuts" and select the command from the list. - Assign a custom keyboard shortcut.
[ { "key": "ctrl+p", "command": "togglePinEditor.togglePinEditor" } ]
- Open the command palette by pressing
-
Save the file and you can use
ctrl+p
to toggle pin the text editor.
You can install "Toggle Pin Editor" by following these steps:
-
Launch Visual Studio Code.
-
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
-
Search for "Toggle Pin Editor" and install it from the Visual Studio Code Marketplace.
If you have any issues, feature requests, or would like to contribute to this extension, please visit the GitHub repository for this project.
This extension is licensed under the MIT License.