Sublime Forum

Add 'Rename...' and 'Delete File' Options in Menu when Right-clicking in Main Textarea

#1

Right now you can only ‘Rename…’ and ‘Delete File’ by right-clicking on an arbitrary file in the sidebar. It would be very convenient if we had these options for the currently opened file when right-clicking in the main textarea.

2 Likes

#2

You could create a file Context.sublime-menu in your User folder with the content

[
    {
        "caption": "Rename",
        "command": "side_bar_rename"
    },
    {
        "caption": "Delete",
        "command": "side_bar_delete"
    },
]

This will add the commands to the right-click context menu. However it might be a good idea to create an issue at SideBarEnhancements so it is added for all users.

6 Likes

#3

There are other ways to delete and rename files. For example, you can use the command palette to quickly delete/rename the current file as follows.

For deletion, enter super+shift+p to open the palette and then start typing delete. Select the command in the drop down menu.

Doing the same with rename opens the console where you can enter the desired new name of current file.

1 Like

#4

The keyboard shortcut for the command palette on my editor is set to ctrl+shift+p instead of super+shift+p. But whenever I type ‘delete/rename’ as you suggested, the commands do not show up (see attached photos).

0 Likes

#5

The commands are provided by SideBarEnhancements, so you will need to install that package to be able to see/use them.

2 Likes

#6

Sorry for the oversight! As noted by @OdatNurd, these commands are part of the SideBarEnhancements package. It is a wonderfully useful package and, together with AdvancedNewFile, makes file manipulation in ST3 a quick and painless affair between the user and the keyboard, leaving the mouse out of the equation.

1 Like