Sublime Forum

Setting VS Code as Editor on Ubuntu

#1

I was wondering if anyone has been successful in setting the editor preference for Sublime Merge to VS Code (or other editor other then Sublime Text)?

I’m on Ubuntu and installed VS Code via apt. I’ve tried setting the Sublime Merge editor value to /usr/bin/code, but that doesn’t appear to work as the menu option for opening in a editor then disappears.

I know it’ll be something silly…

Thanks.

0 Likes

#2

I’ve now also tried this on my Mac and have the same issue.

0 Likes

#3

You might need to change this topic to technical support. Also I don’t have an answer to your problem.

0 Likes

#4

Have done, Thanks @SHADOWELITE7

1 Like

#5

Your welcome

0 Likes

#6

I believe you need to specify the path to the actual executable within the .app bundle.

0 Likes

#7

Still no luck with this. For example I tried this "editor_path": "/Applications/Visual Studio Code.app/Contents/MacOS/Electron". The open in editor option just disappears, sad to say.

0 Likes

#8

Add this to Preferences.sublime.settings file: "editor_argument_format": "-g ${file}:${line}:${col}",

The Windows version shows this field in the “Advanced” tab in “Preferences” but not on macOS… Strange.

0 Likes

#9

I came back to this and used the preference setting like @johneo suggested. This appears to work when I go Sublime Merge -> Preferences -> edit settings. I used the binary path on my Mac machine /usr/local/bin/code.

However, the menu option for opening in editor (the one normally next to the reveal in Finder option, is still missing in action. Would be great to be able to do this to - as this is the main feature I want actually - I don’t mind one off settings menus opting in sublime, mainly want a shortcut to open my projects in my current editor of choice.

Thanks

0 Likes

#10

Hi, from the future.

I just came back to this again, kinda hoping it would have been fixed or I find my silly mistake. However, I’ve still not been able to get the editor integration to work with any other editor base the default (sublime text).

I thought I might try and bump this issue to give it another shot at being resolved. :crossed_fingers:.

Is this the appropriate place to file bugs?

0 Likes

#11

There’s an official bug tracker for Merge at: https://github.com/sublimehq/sublime_merge/issues

That’s the best place to file bugs as well as feature requests, since those sorts of things in the forum can tend to get lost over time.

What version of Merge are you running? There were some changes related to this setting in build 2028. I forget the full details but one consequence of this is that the option to enter this should now be in the preferences dialog where it wasn’t before.

Also, it may be helpful to check the console with Tools > Show Console to see if there are any messages in there that might explain any potential issues.

0 Likes

#12

Using code as the editor path and --goto ${file}:${line}:${col} works perfectly on my computer.

0 Likes

#13

@bschaaf what specifically is working for you? One of the use cases I want is the "open in " option. The Repository > Open in <editor> menu option vanishes for me. I trie to record a gif but I couldn’t make the file size mall enough.

I’ve also tried the absolute path to the code bin as well as a path to the Visual Studio Code.app executable.

EDIT: oh I can right click a file and open in editor, what doesn’t work is opening the whole repository directory in the editor. So I guess this is maybe a feature request, because it probably requires a separate list of editor args to use when opening the directory and not a single file.

0 Likes

#14

Can you see if anything gets logged in the console?

0 Likes

#15

Oh yeah, I did have this open in my gif I forgot to comment. The only logs I get are just that the preferences have been reloaded after changing them.

Though as I updated in my last comment, it does work for me now (if we are talking about being able to right-click a file and open it in the editor). So the configuration seems to be correct. Thanks

The part that isn’t working, and maybe you may not use is the open from the file menu that opens the entire folder in your editor (not a single file). This is under Repository -> Open in <edtior-name>. This disappears for me when I configure VSCode, but reappears when I leave it blank and reads Repository -> Open in Sublime Text.

0 Likes

#16

Yes that is currently a Sublime Text only feature. Feel free to submit a feature request to the official bug tracker for that.

0 Likes

#17

@bschaaf I will do. Thanks for your help in figuring out what was going on; appreciated.

0 Likes