跳到主要内容
版本:1.2

Julia

Install Syntax Highlighting

:TSInstall julia

Install Language Server

The Juila language server, LanguageServer.jl, needs to be manually installed. To install LanguageServer.jl in the location where nvim-lspconfig expects run the following terminal command:

julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")'

Create the file ~/.config/lvim/ftplugin/julia.lua with the following line to start the language server when opening Julia files.

local opts = {}
-- re-use common lsp configurations (keybindings, buffer-highlight and cmp integration)
opts = require("lvim.lsp").get_common_opts()
require('lspconfig').julials.setup(opts)

Supporting Plugins

For Latex-to-Unicode substitutions, block-wise movements, and other niceties for writing Julia, install the julia-vim plugin.

Pro Tip

To leverage the edit functionality with LunarVim use the define_editor method in ~/.julia/config/startup.jl

using InteractiveUtils

ENV["JULIA_EDITOR"] = "lvim"

InteractiveUtils.define_editor(
r"lvim", wait=true) do cmd, path, line
`$cmd +$line $path`
end