How do you make Sublime Text 3 open a file in a new tab instead of opening it in the current tab?

Sublimetext3

Sublimetext3 Problem Overview


When I click the file I want to open in Sublime, it is replacing the current tab I have open. It used to open it in a new tab.

Sublimetext3 Solutions


Solution 1 - Sublimetext3

This is because you were only previewing the previous file. If you click on a file once in the sidebar, by default it opens in preview mode. Clicking another file will open it in preview mode, in the same tab. You can disable this behavior by double-clicking the file in the sidebar, by beginning to edit the file, or via the user settings: select Preferences -> Settings-User and add

"preview_on_click": false,

then save the file. With this new behavior, you will need to double-click on a file in the sidebar to open it, and it will not close if you double-click another file.

Solution 2 - Sublimetext3

Preferences -> Settings-User -> "open_files_in_new_window": false

Solution 3 - Sublimetext3

Open Registry Editor (The easiest way to do this in all versions of Windows is to open the Run dialog box via WIN+R, and enter regedit)

go to :

Computer\HKEY_CLASSES_ROOT\Applications\sublime_text.exe\shell\open\command

change it from :

"C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"

to :

"C:\Program Files\Sublime Text 3\sublime_text.exe" -n "%1"

Solution 4 - Sublimetext3

You can simply go to preferences/settings/preferences.sublime_setting. Under this, after font-size(array), paste this "preview_on_click": false. And you are done!

Note: After this, you have to double click to open any file.

Solution 5 - Sublimetext3

You can use a simple python script to get files to open in a new tab with a single click.

import sublime
import sublime_plugin
import os

class NoPreview(sublime_plugin.EventListener):
    def on_load(self, view):
        if (os.path.exists(view.file_name())):
            view.run_command('save')

Save this script with a .py extension in your sublime packages directory. (Usually ~/.config/sublime-text-3/Packages/User in Linux)

Note: Make sure "preview_on_click" is set to true in Preferences > Settings, otherwise this will not work.

Solution 6 - Sublimetext3

On single click you preview the files. You can double click on the file to open them in a new tab.

Solution 7 - Sublimetext3

You must be having "show tabs" unchecked under the VIEW tab. Check it and you can open a file with a double click.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMark AView Question on Stackoverflow
Solution 1 - Sublimetext3MattDMoView Answer on Stackoverflow
Solution 2 - Sublimetext3user2939562View Answer on Stackoverflow
Solution 3 - Sublimetext3tejas nView Answer on Stackoverflow
Solution 4 - Sublimetext3Shah rukhView Answer on Stackoverflow
Solution 5 - Sublimetext3Kartik ShahView Answer on Stackoverflow
Solution 6 - Sublimetext3Sanket KumbhareView Answer on Stackoverflow
Solution 7 - Sublimetext3Chirag PandeyView Answer on Stackoverflow