Sublime Forum

Customize the folders right-click menu

#1

I frequently search my entire code project directory for some short text. The easiest way I found so far (I’m new to Sublime Text) is by right-clicking on the directory in the left pane. It will show the following popup menu.

I don’t like however the Delete Folder command so close and so available and I would like to customize this popup menu by removing it.

Can you please let me know in which Sublime file I can find this menu so I can remove that command from it?

1 Like

#2

I’m a paying customer, can I expect an answer from Sublime Support team?

0 Likes

#3

Packages/Default/Side Bar.sublime-menu
You can view it with View Package File in the command palette, but if you want to edit it, I recommend installing the OverrideAudit package

1 Like

#4

Thanks @kingkeith but the menu file you mentioned is different than the one Sublime opens when used as I described in my original post. It contains much more commands than what I’m showing in the screenshot above. For example your file has “Delete File”, “Open Containing Folder…” commands, and so on.

I thought that to customize Sublime menus on macOS, the best practice is to copy Sublime original file into /Users/username/Library/Application Support/Sublime Text/Packages/User and edit it there. I was going to simply delete the “Delete Folder” command using VI. Is that not the correct way to do it?

0 Likes

#5

sublime-menu files of the same name all combine together, always (just as settings and key bindings do, for example). So, putting a copy of it in your User folder will cause every item in the base menu to duplicate (except for the one you removed).

What you need to do is copy it into Packages/Default and not Packages/User, so that it overrides the one that’s built in. You can certainly do that manually but (with disclaimers that I’m the author) OverrideAudit is the way to go. Open the file with View Package File, right click in it and pick Override this resource, modify the file as desired, and save.

One of the features of OverrideAudit is that it will tell you when a Sublime update modifies the default menu and adds/removes/alters items because Sublime won’t do that on its own.

That said, this menu file is indeed the file that you want to edit; keep in mind that items in the menu that don’t apply won’t be displayed for you; operations you can only take on folders won’t be offered for files, etc.

One last thing to note is that packages can augment the menu with extra items, so what you see when you look doesn’t always come purely from this one file.

0 Likes