Neovim and Julia - setup advice?


#1

Anyone here use neovim? I used to have a working setup, but I switched to VS Code for a long time (I needed to use Windows, and it was just easier). When I tried to go back to neovim (still on Windows), I find that neoterm has changed a ton, and my config no longer works… and I can’t for the life of me seem to get it running again.

Anyone willing to share their dotfiles/config?


#2

I use SpaceVim, the setup is automatic. It uses LanguageSever.jl, but this package is not working currently.


#3

You can get a sorta-kinda working Language Server install on neovim by

  1. putting this Project.toml and this Manifest.toml into a folder, e.g. ~/.julia/environments/ls
  2. activating that via
$ cd ~
$ julia
pkg> activate .julia/environments/ls
pkg> instantiate
  1. add the contents of this excerpt of my init.vim to yours, call :PlugInstall (and make sure you have the python nvim module installed before so deoplete works fine) – also don’t forget to adjust all paths in there as well as the call to start Julia (j1 in my case)
  2. open a Julia file and see linter warnings etc pop up (first start will take ages since the LS will index all of your Julia packages). Autocompletions are currently broken though, I think.

#4

Thanks for the links, everyone. The init.vim excerpt especially was helpful - got me sorted on the newer neoterm config syntax quickly.

I still had an issue getting things running, but it turned out I was running into this issue. In case anyone runs into similar problems, neovim/neoterm works well enough on Windows once I added the right g:neoterm_eof flag.


#5

Here is my super-simple setup, using https://github.com/Vigemus/iron.nvim for interacting with the REPL. Any suggestions for improvement is appreciated. See also https://github.com/Vigemus/iron.nvim/issues/73

" Julia + REPL config

tnoremap <C->

"let maplocalleader = “,”
autocmd Filetype julia set tabstop=4
autocmd Filetype julia set shiftwidth=4

autocmd Filetype julia nmap §§ :write:call IronSend(“include(”" . expand("%:p") . “”)")
autocmd Filetype julia nmap ,lf :call IronSend(“include(”" . expand("%:p") . “”)")
autocmd Filetype julia nmap ,lr :IronRepl
autocmd Filetype julia vmap ,t (iron-send-motion)
autocmd Filetype julia nmap ,t (iron-send-motion)
autocmd FileType julia nmap ,w :call IronSend("@doc " . expand(""))G

tnoremap <C->h
tnoremap <C->j
tnoremap <C->k
tnoremap <C->l

nnoremap h
nnoremap j
nnoremap k
nnoremap l

inoremap h
inoremap j
inoremap k
inoremap l


#6

I use neovim exclusively, you can see my dotfiles here (by now that repo is pretty detailed).

I mostly just use the excellent julia-vim plugin, I don’t actually use much in the way of linting or anything fancy.