Custom Context Menu
Remove any items from VSCode's context menu (right click menu)
Screenshots
| Before |
After |
 |
 |
Usage
1. install this extension in VSCode
1.5. optionaly, manually set custom-contextmenu.workbenchPath by locating your VS Code installation (e.g., right-click the VS Code shortcut and choose "Open file location"), searching for workbench.html/workbench.esm.html, then right-clicking the file and choosing "Copy as path"; set that path and re-run Enable Custom Context Menu
2. configure custom-contextmenu.selectors, see Selectors configuration
3. open Command Pallete with F1 or ctrl+shift+p
4. select Enable Custom Context Menu
Selectors configuration
Set custom-contextmenu.selectors in your VS Code settings to hide context menu items by their label. Example:
"custom-contextmenu.selectors": [
"^Go to",
"Cut",
"Copy",
"Paste",
"_:has( + ^Find All)"
]
- Plain labels match exact labels (e.g.,
"Copy").
- Prefix with
^ to match items that start with a label (e.g., "^Go to").
- Separators are represented by the placeholder label
"_". Use _:has( + ...) to hide the separator that appears before the matched item, and use the ... + _ pattern to hide the separator after the matched item.
Separator examples:
"custom-contextmenu.selectors": [
"_:has( + Share)",
"Share + _"
]
The first entry hides the separator immediately before the Share menu item (when present). The second entry hides the separator immediately after the Share menu item (when present). If you prefer the fully-quoted syntax, it still works (e.g., "\"Share\" + \"_\"").
Note: Paste + _ (or Share + _) only hides the separator after the item. To hide the menu item itself, add the item label separately (for example, include "Paste").
Note: after changing custom-contextmenu.selectors, re-enable the custom context menu or restart VS Code so the injected script is updated.
Note:
All changes were made by ChatGPT (and I've got no idea how to make vscode extensions or do javascript, but this extension does seem to be working).