This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/julia
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.

The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.

* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
  except for distribution layers (we declare layer dependencies right away in
  distribution layers)
2019-09-30 02:00:48 -04:00
..
img Add dedicated julia layer 2018-08-11 09:16:15 +01:00
config.el Make julia layer declare lsp layer as dependency if enabled 2019-09-10 23:00:34 +02:00
funcs.el [lsp] When used, make LSP the default backend for all supported lang 2019-09-30 00:49:44 -04:00
layers.el [core] Fix layer dependencies based on layer variables 2019-09-30 02:00:48 -04:00
packages.el [lsp] When used, make LSP the default backend for all supported lang 2019-09-30 00:49:44 -04:00
README.org [lsp] When used, make LSP the default backend for all supported lang 2019-09-30 00:49:44 -04:00

julia layer

/TakeV/spacemacs/media/commit/ae5ed6afda8f8cb63d22ffde3e604859e38cc298/layers/+lang/julia/img/julia.png

Description

This layer adds support for Julia to Spacemacs.

Features:

  • Syntax highlighting
  • Repl support
  • Linting
  • Completion
  • Jump-to-definition
  • Documentation on hover

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add julia to the existing dotspacemacs-configuration-layers list in this file.

LSP

This layer can be used with LanguageServer.jl and emacs lsp-mode to provide richer, IDE-like capabilities. To use this layer with lsp, you must do the following:

  1. LanguageServer.jl should be configured automatically, if not, see the documentation of lsp-julia.
  2. define the layer variable julia-backend to lsp in your dotfile
  (setq-default
   dotspacemacs-configuration-layers
   '(
     (julia :variables julia-mode-enable-lsp t)))

To enable language server functionality with this layer, follow the instructions for installation, and then install this layer with:

Warning: LanguageServer.jl has not yet been released for Julia 1.0. If you are using this layer with Julia 1.0, julia-mode-enable-lsp should be set to nil.

LanguageServer.jl tends to have a very long startup time. In the worst case, lsp-mode might give up on the language server before its started, but regardless usage of lsp-mode with Julia can cause long delays when first opening files.

Options

While julia-mode is perfectly usable without configuration or other packages, you can choose to replace the default functionality of using julia-repl as the layer's interactive REPL with the ess REPL and other functionality that comes with it. To do so, install this layer with:

  (setq-default
   dotspacemacs-configuration-layers
   '(
     (julia :variables julia-mode-enable-ess t)))

Key bindings

Key binding Description
TAB Expands latex macro (e.g. \delta).
SPC m l Expands latex macro (e.g. \delta).
SPC m = = Indent line
SPC m = d Deindent line
SPC m = q Indent Sexp
SPC m ' Brings up Julia Repl (starts new one or focuses existing).
SPC m r Brings up Julia Repl (starts new one or focuses existing).
SPC m h h Calls @doc macro on symbol under cursor.
SPC m s a Activate the project of the current buffer (call with prefix to activate home project)
SPC m s d cd into the buffer directory
SPC m s i Brings up Julia Repl (starts new one or focuses existing).
SPC m s b Sends buffer to REPL.
SPC m s t Sends buffer to REPL via Revise.includet.
SPC m s l Sends line to REPL.
SPC m s s Sends line to REPL.
SPC m s r Sends region or line to REPL.
SPC m s m Call @macroexpand on an expression
SPC m s e Call @edit on an expression
SPC m s v Prompt and set a Julia REPL inferior buffer name for the current buffer
SPC m e a Activate the project of the current buffer (call with prefix to activate home project)
SPC m e d cd into the buffer directory
SPC m e i Brings up Julia Repl (starts new one or focuses existing).
SPC m e b Sends buffer to REPL.
SPC m e t Sends buffer to REPL via Revise.includet.
SPC m e l Sends line to REPL.
SPC m e s Sends line to REPL.
SPC m e r Sends region or line to REPL.
SPC m e m Call @macroexpand on an expression
SPC m e e Call @edit on an expression
SPC m e v Prompt and set a Julia REPL inferior buffer name for the current buffer