Sublime Forum

How to open file in new window

#1

I am using sublime text 3 in Windows 10. When I click a file in File Explorer, sublime always opens the file in a new tab of the same window. But I want sublime to open a file ALWAYS in a new window. I don’t like using tabs. I hate tabs. In no way I like tabs.

Is there anyway sublime can always open a file in a new window? Thanks for help. I dont need any workaround. I need a NEW WINDOW. Please DO NOT provide a workaround.

2 Likes

#2

Steps:

  1. Rename sublime_text.exe into _sublime_text.exe
  2. Compile this batch script into an executable (with Bat To Exe Converter). Here is a compiled one.
  3. Name the compiled executable with sublime_text.exe
  4. Put sublime_text.exe to where _sublime_text.exe is.
  5. Done.

Thoughts:

  1. The -n argument makes ST start in a new window.
  2. Write a script to call the original ST and inject -n.
2 Likes

#3

What happens in the event of an update?   I’m assuming that the modified sublime_text.exe would be overwritten or possibly cause an issue with the update.

Is there a way to implement that without altering ST’s default files?

Idea:  Kind of a hassle, but maybe it would be better to set the ( arbitrarily named ) compiled batch file as the default application for all desired filetypes.
 

Edit:

 
If you’re on windows, this might help with updating your file associations:

Programatically associate file extensions with application on Windows

3 Likes

#4

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”

1 Like

#5

An old message thread but I guess there’s still no way to do this natively in the application.

My main use case is starting Sublime by typing its (partial) name after pressing the Windows key. That has an easy solution.

  1. Press Windows key, start typing Sublime until it matches Sublime Text
  2. Right click on the match and select Open file location
  3. Right click on the shortcut and select Properties
  4. In the Target field, add -n to command so that it looks like
    "C:\Program Files\Sublime Text 3\sublime_text.exe" -n
  5. Click OK to save

The next time you open Sublime via the Windows key, it will open in a new window.

0 Likes

#6

Hi,

Is there a way to solve this natively?
The workaround suggested by @gauss256 did not work for me. The files are open in tabs still rather than a new sublime window.

My problem is that I use virtual desktops, so every time I open a file (whose default program is Sublime of course) from the file explorer, it changes to the desktop where Sublime is located.

0 Likes

#7

The "open_files_in_new_window" setting was added in build 4114.

0 Likes