Set up Sublime Text 3 for Julia

question

#1

I want to set up Sublime Text 3 for Julia, but could not find a detailed instruction. I followed this guidance:

but I am not sure how to link Julia to it.


#2

Pretty sure you don’t – that plugin only provides

  • Syntax highlighting
  • Unicode tab completion (like the REPL)
  • Auto-indentation
  • Snippets

so there’s no need for a connection to a local julia installation or anything like that. That also means you’re going to miss out on the integration that VSCode/Juno/the-LSP-enabled-editor-of-your-choice provides though.


#3

I saw it under the Editor support, so how can I use Julia in sublime next


#4

You can’t use Julia in Sublime Text, but you can write your code in ST3 and include it (or use Revise.jl) in a separate REPL session.


#5

There used to be a way to run a Julia REPL (Edit: I think it may have been an IJulia terminal, actually) inside Sublime, but that was a long time ago, I don’t know if that works now.

You can run a terminal next to the editor and use https://github.com/randy3k/SendCode to send the code to the REPL. In my experience, it works quite well, but that is the workflow I abandoned in favour of VS Code and Juno, without any regrets. The ST workflow is limited in comparison.


#6

I think some very brave folks might have gotten (or at least tried) LanguageServer.jl hooked up with Sublime, which would give you some more integration. But I’m not sure whether it actually worked in the end.


#7

Yes, you can, I use it all the time. The instructions on how to install Sublime-Ijulia plugin for Sublime text are found on the page at Github: https://github.com/quinnj/Sublime-IJulia.


#8

Right, completly forgot about that plugin. Sorry for spreading misinformation :slight_smile:


#9

Sublime Text users could use run LanguageServer.jl vis https://github.com/randy3k/LSP-julia and LSP.

I should have put it in the README of JuliaEditorSupport/Julia-sublime


#10

You might want to checkout https://github.com/ngr-t/SublimeHermes for jupyter support (especially the use_jupyter_client branch)


#11

The terminal can be run inside ST3 (I like Terminus). The package SendCode is capable of sending Julia lines, selections, etc. to the terminal running within the editor. It works very smoothly.


#12

Is it possible to upload this package to package control or to the official LSP package?


#13

Here is my favourite for the Terminus Command Palette. If there is an open (.jl) file, the this opens up Julia (in the same folder) on the right side of the screen:

[
 	{
         "caption": "Terminus: Open Julia",
         "command": "terminus_open",
         "args"   : {
             "cmd": ["d:/Julia/julia10.cmd"],
             "cwd": "${file_path:${folder}}",
             "title": "Julia 1.0",
				      "pre_window_hooks": [
               ["set_layout", {
                   "cols": [0.0, 0.6, 1.0],
                   "rows": [0.0, 1.0],
                   "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
               }],
               ["focus_group", {"group": 1}]
            ]           

         }
     },	
]

The Julia10.cmd file contains just D:\Julia\Julia-1.0.1\bin\julia.exe (maybe I could bypass that).


#14

This works beautifully. I have simplified this a tiny bit by "cmd": ["julia"], as I make sure the Julia executable is in the path.

By the way, is the correct procedure for installing this command to put it in the In Default.sublime-settings in the Terminus package?


#15

By the way, kudos and many thanks to Randy Lai (@randy3k) for the packages SendCode and Terminus. Beautifully done and eminently useful for Sublime Text 3!


#16

Indeed, now I am interested in LanguageServer integration for even better Julia experience. Does LanguageServer properly work with julia 1.0 yet?


#17

is the correct procedure for installing this command to put it in the In Default.sublime-settings in the Terminus package?

Not sure. I just did Ctrl+Shift+P and then Preferences: Terminus Command Palette


#18

Right, that makes sense. Thanks.


#19

Randy,

Doesn’t this require LanguageServer.jl? I believe it only works for Julia version 0.6 (@davidanthoff)…?

By the way, it isn’t quite clear to me how https://github.com/randy3k/LSP-julia interacts with the package LSP and the actual language server. If I read your python plug-in correctly, you start LanguageServer in Julia. Did this work with Julia 0.6?

To configure LSP I did

{
	"clients": {
		"julials":
		{
		  "command": ["julials"],
		  "scopes": ["source.julia"],
		  "syntaxes": ["Packages/User/Julia-sublime/Julia.sublime-syntax"],
		  "languageId": "julia"
		},
	},
	"log_debug": true,
}

Does that look about right?

The weird thing is Julia.sublime-syntax was not installed through Package Control when Julia syntax-highlighting was installed as a package. I had to find it and copy it manually into the User settings folder.