Sublime Forum

How to create shortcut to delete current file

#1

I want to create shortcut to delete the current file. And forgo the dialog box message “are you sure you want to delete this file…?”. Anybody know the command for that shortcut?

0 Likes

#2

Try:

TabsExtra

 



 
It gives you a ton of options when you right click on tabs, including Delete File:

 
However, I’m not sure that it’s possible to bypass the confirmation dialog…

0 Likes

#3

You could create your own plugin and copy the implementation from TabsExtra but just remove the prompt - https://github.com/facelessuser/TabsExtra/blob/master/tabs_extra.py#L834

1 Like

#4

isn’t that the default context menu already have the delete feature? I used that all the time. However I’m looking for faster way, like press alt+shift+delete to delete the current file. any idea?

0 Likes

#5

create a keybinding for it http://docs.sublimetext.info/en/latest/reference/key_bindings.html

1 Like

#6

 
That’s bold man, I’d be afraid to have such a command as a key binding, especially without the confirmation lol  :sweat_smile:

 
Between the two links @kingkeith shared you should be able to put together a simple plugin & map a key binding to it.

1 Like

#7

I think it sends to the recycle bin, so it’s not too dangerous, but yeah 'tis bold :wink:

1 Like

#8

serious guy, can it be a little more detail. I don’t know anything about the py stuff.

0 Likes