Sublime Forum

Open file in current tab (instead of new tab)

#1

Hi, is there a way to open file in the current tab instead of creating a new one?

I work with dozens of files and since I’m lazy to close the old file when switching to new one, I end up with plenty of tabs opened. After a while I close all tabs except the current one, since having 50 tabs is not useful anymore. If the new file replaces the current one, I can control which files deserves its own tab easily. I know I can create a custom command, but there are a lot of ways how to open a file and I want all of them to do it.

0 Likes

#2

Sounds like you need to create a lot of custom commands then :wink:.

0 Likes

#3

Just press ctrl+w (or cmd+w if you are on a mac) before opening a file. Done.

0 Likes

#4

Thanks for the replies. Writing custom scripts is probably the best way. It shows up I can’t override the command called in overlay, but there are hooks on opening, loading and activating a view. I don’t have the script yet because of some problems with API, but it can be done.

Closing a file before opening new one is no option for me - it’s too much keystrokes and I have to think of it. I would give up using tabs than do it if I had to.

0 Likes