首页 > 解决方案 > 从 ST 菜单覆盖或删除默认项目

问题描述

有没有办法覆盖或删除Sublime Text 菜单中的某些默认项目,而不复制其整个代码?

例如,如果我想从侧边栏菜单中删除“删除文件”和“删除文件夹”项目,则有必要创建“侧栏.sublime-menu”文件的整个副本(当然要进行适当的更改)。

地点

Packages\Default\Side Bar.sublime-menu

内容

[
    { "caption": "New File", "command": "new_file_at", "args": {"dirs": []} },
    { "caption": "Rename…", "command": "rename_path", "args": {"paths": []} },
    // { "caption": "Delete File", "command": "delete_file", "args": {"files": []} },
    { "caption": "Open Containing Folder…", "command": "open_containing_folder", "args": {"files": []} },
    { "caption": "Reveal Link Source", "command": "reveal_link_source", "args": {"dirs": []} },
    { "caption": "-", "id": "repo_commands" },
    { "caption": "Open Git Repository…", "command": "sublime_merge_open_repo", "args": {"paths": []}},
    { "caption": "File History…", "command": "sublime_merge_file_history", "args": {"files": []}},
    { "caption": "Folder History…", "command": "sublime_merge_folder_history", "args": {"paths": []}},
    { "caption": "Blame File…", "command": "sublime_merge_blame_file", "args": {"files": []}},
    { "caption": "-", "id": "folder_commands" },
    { "caption": "New Folder…", "command": "new_folder", "args": {"dirs": []} },
    // { "caption": "Delete Folder", "command": "delete_folder", "args": {"dirs": []} },
    { "caption": "Find in Folder…", "command": "find_in_folder", "args": {"dirs": []} },
    { "caption": "-", "id": "end" }
]

出于显而易见的原因,最好避免这种重复。有没有办法实现它?

标签: sublimetext3sublimetextsublime-text-plugin

解决方案


推荐阅读