set tgc color darcula set ff=unix ffs=unix,dos set sw=4 ts=4 noet tw=80 cc=80 set spr sb set pb=12 winbl=12 set fcs=eob:\ list lcs=tab:\│\ ,trail:⎵ " on windows, prevents hanging! on unix, get rid of this. " nmap let g:mapleader = " " set mouse=a function s:InitLSP() lua <e", "lua vim.diagnostic.open_float()") nn("p", "lua vim.diagnostic.goto_prev()") nn("n", "lua vim.diagnostic.goto_next()") local function onattach(client, buf) local function nn(from, to) vim.api.nvim_buf_set_keymap(buf, "n", from, to, opts) end nn("gD", "lua vim.lsp.buf.declaration()") nn("gd", "lua vim.lsp.buf.definition()") nn("K", "lua vim.lsp.buf.hover()") nn("gi", "lua vim.lsp.buf.implementation()") nn("", "lua vim.lsp.buf.signature_help()") nn("D", "lua vim.lsp.buf.type_definition()") nn("r", "lua vim.lsp.buf.rename()") nn("A", "lua vim.lsp.buf.code_action()") nn("R", "lua vim.lsp.buf.references()") nn("f", "lua vim.lsp.buf.formatting()") end local servers = {"clangd"} -- add others here if you use them! for _, lsp in pairs(servers) do lspconfig[lsp].setup { capabilities = caps, on_attach = onattach, flags = {debounce_text_changes = 500} } end local config = { cmd = { 'java', '-Declipse.application=org.eclipse.jdt.ls.core.id1', '-Dosgi.bundles.defaultStartLevel=4', '-Declipse.product=org.eclipse.jdt.ls.core.product', '-Dlog.protocol=true', '-Dlog.level=ALL', '-Xms1g', '--add-modules=ALL-SYSTEM', '--add-opens', 'java.base/java.util=ALL-UNNAMED', '--add-opens', 'java.base/java.lang=ALL-UNNAMED', '-jar', '/home/fabiclawz/jdtls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar', '-configuration', '/home/fabiclawz/jdtls/config_linux', '-data', '/home/fabiclawz/jdtls/data' }, root_dir = require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}), settings = { java = { } }, init_options = { bundles = {} }, } require('jdtls').start_or_attach(config) EOF endfunction au VimEnter * call s:InitLSP()