Skip to content
Snippets Groups Projects
Commit 304f578c authored by xo30xoqa's avatar xo30xoqa
Browse files

Created editors.md with instructions for setting up Emacs.

parent 35faa28a
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
**An agent-based, socio-economic-ecological model of agricultural landscapes **An agent-based, socio-economic-ecological model of agricultural landscapes
in Europe under the CAP.** in Europe under the CAP.**
## Description ## Description
Persephone models farmers' decision making and its impact on species in agricultural Persephone models farmers' decision making and its impact on species in agricultural
...@@ -15,13 +15,13 @@ It is currently in the very early stages of development. ...@@ -15,13 +15,13 @@ It is currently in the very early stages of development.
Install the latest version of the [Julia](https://julialang.org/downloads/) programming Install the latest version of the [Julia](https://julialang.org/downloads/) programming
language. The recommended editors are [VSCode](https://www.julia-vscode.org/) or language. The recommended editors are [VSCode](https://www.julia-vscode.org/) or
[Emacs](https://www.emacswiki.org/emacs/JuliaProgrammingLanguage). [Emacs](https://www.emacswiki.org/emacs/JuliaProgrammingLanguage) (see `docs/editors.md`).
Then, open a Julia commandline and install the
[Agents.jl](https://juliadynamics.github.io/Agents.jl/stable/) framework using
`using Pkg; Pkg.add("Agents")`.
Run the simulation by executing `run.jl` from the commandline, or loading it from Run the simulation by executing `run.jl` from the commandline, or loading it from
within a Julia REPL with `include("run.jl")`. within a Julia REPL with `include("run.jl")`. All dependencies should be
automatically installed.
This model uses the [Agents.jl](https://juliadynamics.github.io/Agents.jl/stable/) framework.
--- ---
......
# Julia editors
## Emacs
There are a couple of addons that make working with Julia much nicer in Emacs:
1. `julia-mode` gives syntax highlighting. Install with `M-x package-install julia-mode`.
2. [`julia-snail`](https://github.com/gcv/julia-snail) provides IDE-like features,
especially a fully-functional REPL and the ability to evaluate code straight from inside a buffer.
Note that the installation can be somewhat tricky. You first need to manually install
all the dependencies of its dependency [vterm](https://github.com/akermu/emacs-libvterm),
then install vterm itself with `M-x package-install vterm`, *before* you can do
`M-x package-install julia-snail`. Then add it to your `init.el` with
`(require 'julia-snail)` and `(add-hook 'julia-mode-hook #'julia-snail-mode)`.
3. [`Revise.jl`](https://timholy.github.io/Revise.jl/stable/) allows one to reload code
without restarting the Julia interpreter. Get it with `Pkg.add("Revise")`, then
add `using Revise` to `.julia/config/startup.jl` to have it automatically available.
4. [`company-mode`](http://company-mode.github.io/) integrates with Snail to give code
completion. Install with `M-x package-install company`, then add
`(add-hook 'julia-mode-hook #'company-mode)` and
`(global-set-key (kbd "C-<tab>") 'company-complete)` to your `init.el`.
5. [`magit`](https://magit.vc/) is a great git interface for Emacs. Install with
`M-x package-install magit` and add `(global-set-key (kbd "C-x g") 'magit-status)`
to your `init.el`.
## VSCode
See [here](https://www.julia-vscode.org/).
*TODO: add more detail.*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment