Sublime Text 3: Worth a look!

@PetrKryslUCSD Thanks for the detailed setup guide. SublimeText is my favorite editor for everything non-Julia. I gave it a try and I quite like it, but I have the following 2 minor gripes:

  1. Calling help on a function with ? doesn’t work. This is the same for other special REPL modes like ;. The ? can be worked around by a keyboard shortcut to call the help using the REPL module as you suggest but I find it slightly annoying.
  2. If there is a way to have plots show in a plot pane instead of showing in their own window, that would be nice.

Thanks again for the detailed guide.

Can you elaborate a bit on what isn’t working? Both of these modes work for me in ST3.

Does it work for you when you write ? log and send it to REPL with SendCode?

I use ST3 with git bash: I first fire up git bash, and then inside it I start sublime text (subl.exe). The git bash then “propagates” into ST3/Terminus and the Ctrl-Enter command would have worked unchanged.

Indeed, ?log can be made to work. Set

{
    "prog": "terminus",
    "julia" : {
        "prog": "terminus",
        "bracketed_paste_mode": false
    }
}

in SendCode.sublime-settings. The key is the bracketed paste mode setting.
There is some interaction with the code though. I don’t think documentation strings are interpreted correctly anymore when the bracketed paste mode is set to false. More experimentation is needed.

Oh, and the key binding is:

{
        "keys": ["ctrl+shift+x", "ctrl+alt+h"], "command": "send_code",
        "args": {"cmd": "?$selection"},
        "context": [
            { "key": "selector", "operator": "equal", "operand": "source.julia" }
        ]
    },
3 Likes

Awesome this works! Thanks for your response. I will keep playing with this a bit more.

Finally bit the bullet and spent some time setting up Sublime following this guide https://github.com/PetrKryslUCSD/HowToUseJuliaWithSublimeText3

I wish Juno is less lethargic-feeling. Wonder if it’s Atom or all the wizardardry we try to put into Atom. But it became too clunky for me to handle. Also, start up time regressions in 1.3 is not that nice. Also some pacakges just seem to take forever to start e.g. using Zygote, Flux takes 1 minute for me.

Overall, it’s way too depressing for me cos everything feels so slow T_T. Sorry about this gripe, and I wish I know more to help with this, but it almost feels like it’s not worth using Julia at all because everything feels so lethargic. True feelings at this depressing moment.

2 Likes

Chin up xiaodai, tomorrow’s a new day, new tools. You’ll likely come up with an interesting hybrid tool usage model, and would be most interested if you’d pop back in once in a bit and share your findings!
Funny, this week was on a conference call with an old colleague who wanted to understand some of this space (data science w/ notebooks, Julia, etc., and maybe some maths as he was a physicist by training). Sublime was snappy, started there showing the REPL and interaction on both sides. Then opened a term and used REPL, then launched Jupyter notebook from there and showed how notebooks worked.
Then launched Atom to show another option, and it took quite a while to load, and then loaded system heavy enough for a bit that the conference call lagged for a moment. He commented and we just moved on, and I didn’t even bother to show VSCode.
But, on the flipside I read a thread yesterday about profiling code, and see the amazing tooling in Atom for that. Or watching Chris R in his package tutorial vid, and the snazzy stuff that Atom can do. Am hoping that when I’m ready to grow into that tool more, it will be more mature as well.
Have a good one.

Not sure if it’s just me but Revise doesn’t seem to work inside Juno for me. Juno is the most feature complete, and is meant to have good support for debugging. I love the @edit macro. But if everything takes longer to start then it’s a bit weird.

It should work.

I even added a Revise button in my Atom package to make using it easier.

@xiaodai Where is your issue with it? Please open up issues if you face anything.

I have never had any issues inside latest Atom + uber-juno, and it opens up very fast and gets ready to work as I showed in this post (Sublime Text 3: Worth a look! - #25 by Amin_Yahyaabadi)

I have been using Sublime Text 3. The quality of life improvement for me is HUGE! I no longer get the very lethargic feel when running Julia code.

Compilation latency is still an issue, but not such a bad thing anymore!

3 Likes

Is there a way to let things like

using TableView
showtable(iris)

open up a browser instead?

It prints to the REPL which isn’t very useful

That’s GREAT @xiaodai! BTW, the Seti-UI theme matches the Atom environment, so if you are switching back and forth for things it may be a better experience.

Interesting idea, sort of a SendCode from the REPL out to HTML. So, started thinking about approach such as with a MarkDown file in one pane and a live HTML preview in the other (there are packages for this Send to Browser). Was thinking of instead of showtable going to STDOUT of the term, perhaps that can be redirected to a file, that in turn opens and is sent to a browser. But wait WAIT, there’s PrettyTables that now has HTML output and can be saved to HTML, so it might be a few step workflow that could be streamlined. Perhaps a job that watches a folder where the Julia HTML file is saved, which triggers a command to open the file in ST3, followed by a Preview in Browser?
See this comment by @Ronis_BR:

I was going to grab his example and try it but it’s a screenshot, but might have time later to try some more, will take a look. I already have HTML going to browser no problem.

1 Like

Actually on Julia 1.2

using Blink
w = Window()
body!(w, showtable(iris))

works.

It just didn’t work for me on Julia 1.3-rc4. But it’s kinda clunky as it needs to launch a browser. But works pretty well.

https://github.com/JuliaComputing/TableView.jl/issues/32

2 Likes

Revise doesn’t seem to work inside Juno for me:

You are not alone. I am experiencing the same issue on several Windows & Ubuntu PCs.

Putting this in my startup.jl helped

println("Running startup.jl")

println("using Revise")
atreplinit() do repl
    try
        @eval using Revise
        @async Revise.wait_steal_repl_backend()
    catch
    end
end

println("Finished running startup.jl")

@xiaodai, I tried that already with help of @pfitzseb :

https://discourse.julialang.org/t/revise-seems-not-triggered-in-juno-ide/30479/3

Julia gets crashed throwing EXCEPTION_ACCESS_VIOLATION.

For the time being, I will give up on Atom/Juno. Maybe it is time for me to try sublime text 3.
I just installed and it feels really fast indeed.

Hi @pontus!

Yes, PrettyTables now has HTML support and I will do my best to release a version with this support by this weekend. My “major” problem is to write a proper documentation and create the test cases.

Let me know if you need anything special inside this back-end. It is in early stage of development, thus we can make big changes before reaching a final, stable API :slight_smile:

1 Like

Sweet! @Ronis_BR, if you could perhaps paste the example code you provided in your recent announcement thread into a post there using the triple-backticks for code quoting, it would avoid retyping to test with what is already working for you at present capability level. I looked in your test files and through the source code, but could only find .png files (e.g. in /PrettyTables.jl/tree/master/docs/ assets /). Thanks!

Very nice! Will give this a look as well…

1 Like