# Julia Spacemacs layer

**URL:** <https://discourse.julialang.org/t/julia-spacemacs-layer/9584>\
**Category:** Tooling\
**Created:** [March 8, 2018, 2:39am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584 "2018-03-08T02:39:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 8, 2018, 2:39am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/1 "2018-03-08T02:39:50Z")

</div>

Hi everyone. Just wanted to announce to any emacs/spacemacs users that I’m  
working on a [spacemacs layer for  
Julia](https://github.com/syl20bnr/spacemacs/pull/10444). Based on the current  
number of open PRs, I doubt it will be merged any time soon, but it can still be  
useful even if it’s not in the core spacemacs distribution. While the ESS layer  
already supports Julia, I think it makes sense to not keep the emacs Julia  
experience so tied together with R. Also, integrating julia-mode with lsp-mode  
already gets you a lot of the features from ESS, so it’s not like we need it  
once lsp-mode stabilizes a bit.

I’m a relative newcomer to elisp, and as you can see in the PR description,  
there are a few kinks with the layer right now, so I’d really appreciate any  
help Y’all could offer. Especially helpful would be anyone who knows how to iron  
out the mentioned kinks with lsp-ui or who’s interested in digging through the  
ESS layer and moving the Julia-specific functionality into the new Julia layer  
as an alternative backend.

Best,

Adam

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 8, 2018, 7:00am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/2 "2018-03-08T07:00:40Z")

</div>

> [@non-Jedi](#):
>
> I think it makes sense to not keep the emacs Julia experience so tied together with R

Do you know about

> **[GitHub - tpapp/julia-repl: Run an inferior Julia REPL in a terminal inside Emacs](https://github.com/tpapp/julia-repl)**
>
> Run an inferior Julia REPL in a terminal inside Emacs - GitHub - tpapp/julia-repl: Run an inferior Julia REPL in a terminal inside Emacs

? It is completely independent of ESS.

---

<div class="post-metadata">

**Author:** ![antoine-levitt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/antoine-levitt/32/4008_2.png) [@antoine-levitt](https://discourse.julialang.org/u/antoine-levitt)\
**Post date:** [March 8, 2018, 9:35am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/3 "2018-03-08T09:35:42Z")

</div>

FWIW ESS is not that tied to R - I use it for julia and don’t use R. Not sure about Spacemacs vs emacs, but more people use emacs than spacemacs, so would it make sense to make part of your package emacs-centric (and/or merge with julia-repl) and add a thin layer for spacemacs on top?

---

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [March 8, 2018, 9:40am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/4 "2018-03-08T09:40:29Z")

</div>

I always used julia with the ess layer in spacemacs, are there any conflict if you install both? I also use R and need ESS.

I also added some more key bindings: [https://github.com/syl20bnr/spacemacs/pull/9920](https://github.com/syl20bnr/spacemacs/pull/9920)

I made a (failed) attempt to fix the language server: [https://github.com/gdkrmr/lsp-julia](https://github.com/gdkrmr/lsp-julia)  
Did you get the language server to work?

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 8, 2018, 12:30pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/5 "2018-03-08T12:30:33Z")

</div>

Yep! And thanks! The spacemacs layer, if you click through, is really

just a thin layer of keybindings tying together your julia-repl with

lsp-mode.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 8, 2018, 12:46pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/6 "2018-03-08T12:46:40Z")

</div>

Hm. I had been planning on offering ESS and lsp as alternative backends  
to the Julia layer, but I haven’t tried them both together. Although  
there’s a lot of overlapping functionality, it’s possible they don’t  
conflict. Maybe the better thing would be to have toggles available  
enabling both ESS and lsp rather than a switch where you have to pick  
one.

And ya, I did get lsp-julia working. The trick is that you have to  
increase `lsp-request-timeout` from its default value of 10 seconds to  
give Julia time to spin up. That’s what I did in the Julia layer, but I  
should probably push that upstream to lsp-julia. Maybe I’ll wait until  
the maitainer responds to my current 2 PRs, though.

Quoting gdkrmr (2018-03-08 04:45:38)

---

<div class="post-metadata">

**Author:** ![ndbecker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ndbecker/32/10829_2.png) [@ndbecker](https://discourse.julialang.org/u/ndbecker)\
**Post date:** [March 8, 2018, 1:08pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/7 "2018-03-08T13:08:34Z")

</div>

Is lsp only for microsoft platforms?

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 8, 2018, 1:33pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/8 "2018-03-08T13:33:58Z")

</div>

Nope. [Julia’s language server](https://github.com/JuliaEditorSupport/LanguageServer.jl) runs in pure Julia and on any platform that Julia runs on, and [lsp-mode](https://github.com/emacs-lsp/lsp-mode) ties directly into the language server. I think there’s language server implementations for neovim and atom, too, but I’m less familiar.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 8, 2018, 1:48pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/9 "2018-03-08T13:48:12Z")

</div>

> [@non-Jedi](#):
>
> but I should probably push that upstream to lsp-julia

Please do. Having a well-documented workflow for Emacs + lsp + Julia would be great. I can occasionally get it working but the experience is never smooth, so I always give up on it and decide to check back later.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 8, 2018, 1:56pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/10 "2018-03-08T13:56:38Z")

</div>

Not sure if the maintainer at [https://github.com/MartinWolke/lsp-julia](https://github.com/MartinWolke/lsp-julia) is active or not, but I’ll at least push a fix to my fork at [https://github.com/non-Jedi/lsp-julia](https://github.com/non-Jedi/lsp-julia) in the next week or so. If he doesn’t merge the PR for an extended time, we can see about getting the links at [https://github.com/JuliaEditorSupport/LanguageServer.jl](https://github.com/JuliaEditorSupport/LanguageServer.jl) pointed at my fork or something.

---

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [March 8, 2018, 4:49pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/11 "2018-03-08T16:49:20Z")

</div>

There are some really useful features in ESS and spacemacs, like help integration by pressing `K` in normal mode.  
ESS acquired the ability to integrate with emacs jump handlers recently ([https://github.com/syl20bnr/spacemacs/pull/10281](https://github.com/syl20bnr/spacemacs/pull/10281)), it works perfectly in R, not sure about julia.  
and then there is convenience stuff like sourcing a function with `,,` or `C-c C-c` which works well in R but not in julia.  
And not to forget that ESS has a complete debugger for R, I have no Idea though if this could provide an infrastructure for a julia debugger.

edit:  
and not to forget `ess-remote` if you want your process to be on a remote machine.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 8, 2018, 5:33pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/12 "2018-03-08T17:33:48Z")

</div>

- help integration (provided by lsp)
- jump handlers (provided by lsp)
- sending whatever to be evaluated (provided by julia-repl but could be  
improved tbh)
- debugger. Better store with julia-repl than ESS since Gallium is usable  
there, but still work to do on both fronts.
- ess-remote. Not familiar with it but probably not available in this setup.

EDIT: @gdkrmr, I encourage you to try out the layer in my PR in OP. Would love  
to hear what functionality is missing from your perspective (You might have to  
disable the ESS layer for everything to work properly atm).

---

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [March 8, 2018, 5:55pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/13 "2018-03-08T17:55:10Z")

</div>

I will do that!

with `ess-remote` you can transform any `shell`-buffer into a repl, you can do that after logging into a remote machine.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 8, 2018, 6:18pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/14 "2018-03-08T18:18:45Z")

</div>

> [@non-Jedi](#):
>
> provided by julia-repl but could be improved tbh

Please do not hesitate to open issues/PRs.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 10, 2018, 12:08am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/15 "2018-03-10T00:08:47Z")

</div>

See my upstream PR [here](https://github.com/MartinWolke/lsp-julia/pull/10)  
please to increase the timeout. Or just pull from master on my fork for now.  
Documentation still needs work (lsp-flycheck doesn’t exist anymore, etc.), but  
one thing at a time for now.

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [March 30, 2018, 1:44am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/16 "2018-03-30T01:44:37Z")

</div>

Is this different than [https://github.com/mgxm/julia-layer](https://github.com/mgxm/julia-layer) ?

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [March 30, 2018, 2:12am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/17 "2018-03-30T02:12:51Z")

</div>

Yes, although I hadn’t seen that one before. Goal of this is to get it actually  
merged into spacemacs once I get time to finish it; that way we have a single  
nice layer where we can control what backing packages are used (ESS, lsp,  
julia-repl, etc.). Big difference right now is that this PR has a semi-working  
lsp integration.

---

<div class="post-metadata">

**Author:** ![vv111y](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vv111y/32/4820_2.png) [@vv111y](https://discourse.julialang.org/u/vv111y)\
**Post date:** [August 2, 2018, 5:12pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/18 "2018-08-02T17:12:39Z")

</div>

How has this been running? I saw this [julia: to lisp or not to lisp?](https://www.youtube.com/watch?v=dK3zRXhrFZY) and am now interested in Julia.  
EDIT: okay I looked at the comments from your PR. I’ll try it out, thanks for making this

---

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [August 3, 2018, 7:46am UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/19 "2018-08-03T07:46:43Z")

</div>

I think it is pretty good and the experience is better than ess. I don’t really know why the spacemacs maintainers won’t merge this into the develop branch.

---

<div class="post-metadata">

**Author:** ![findmyway](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/findmyway/32/4946_2.png) [@findmyway](https://discourse.julialang.org/u/findmyway)\
**Post date:** [August 3, 2018, 2:34pm UTC](https://discourse.julialang.org/t/julia-spacemacs-layer/9584/20 "2018-08-03T14:34:02Z")

</div>

Agree. I’ve been watched that PR for a long time. Don’t know why it hasn’t been merged yet

[Next page](https://discourse.julialang.org/t/julia-spacemacs-layer/9584.md?page=2)
