Sublime Forum

Merge feature request / pro-tip: Open from address bar [Win10]


You can launch Merge from the terminal via smerge.

In windows it’s also convenient being able to launch Merge from the address bar.

VSCode already has a similar command(where I got the idea from). All that’s required is the following file:


@echo off
"%~dp0\smerge.exe" %*

Usage is smerge.cmd . in the address bar (Alt+D to focus) - this will open Merge in the current directory.
You can replace the dot with any relative path.

This is something anyone can do for their local installation, but I thought it’d be neat if it came with the official release.



Can you clarify: which address bar, the one from Windows Explorer? And where should the .cmd file be placed, anywhere in PATH or rather a specific location?



Oh yea, windows explorer address bar.

It needs to be in the same location as smerge.exe for this line to work: "%~dp0\smerge.exe" %*.
And smerge is already in PATH, so this command also ends up accessible from everywhere.



Cool, didn’t know you could run commands from the address bar. However you don’t need the .cmd file it seems, since you can just invoke executables directly and with arguments. I.e. without the .cmd file I can call smerge . and it will open the directory just fine.

And smerge is already in PATH

Not for me actually, not sure if all installers do that.



True dat. I wonder why vscode has a specific command.



I don’t think the installers for Text or Merge modify the path at all; both have command line “helper” applications you can use but they require that you update the PATH manually if you want to use them.

The only exception to this is Linux (and in particular if you use a package manager to install it) because the packaged versions put the appropriate script into a standard location that’s already on the PATH.