set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath = &runtimepath source ~/.vimrc lua << EOF -- Set LSP keymappings in on_attach (i.e. only in buffers with LSP active) local on_attach = function(client, bufnr) opts = { noremap=true, silent=true } vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) end -- Julia LSP (LanguageServer.jl) require'lspconfig'.julials.setup({ on_new_config = function(new_config, _) local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia") if require'lspconfig'.util.path.is_file(julia) then new_config.cmd[1] = julia end end, -- This just adds dirname(fname) as a fallback (see nvim-lspconfig#1768). root_dir = function(fname) local util = require'lspconfig.util' return util.root_pattern 'Project.toml'(fname) or util.find_git_ancestor(fname) or util.path.dirname(fname) end, on_attach = on_attach, }) EOF