Neovim and Julia - setup advice?

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?

1 Like

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

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.
1 Like

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.

1 Like

Here is my super-simple setup, using GitHub - Vigemus/iron.nvim: Interactive Repl Over Neovim for interacting with the REPL. Any suggestions for improvement is appreciated. See also scroll terminal after IronSend · Issue #73 · Vigemus/iron.nvim · GitHub

" 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

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.

1 Like

I integrated @ExpandingMan config with CoC for autocompletion and linting and now it works nearly perfectly! I have only one problem: if I try to use the visual send key sequence, I end up replacing everything I select with a lot of v. I suppose that that is because the r key in visual mode triggers a replace. How can I overcome this?
Forgive me for such a noob question

I even tried to substitute the ‘r’ in the shortcut with a ‘j’, and then simply nothing happens