nvim: setup for java development

master
tiyn 3 years ago
parent 91f0c4aaf8
commit 745d1a6321

@ -134,7 +134,7 @@ end
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { "pyright", "java_language_server", "bashls", "tsserver", "texlab", "ccls", "gopls", "hls", "nimls" }
local servers = { "pyright", "bashls", "tsserver", "texlab", "ccls", "gopls", "hls", "nimls" }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach=on_attach,
@ -143,6 +143,17 @@ for _, lsp in ipairs(servers) do
}
}
end
require'lspconfig'.jdtls.setup{
on_attach=on_attach,
flags = {
debounce_text_changes = 150
},
cmd = { 'jdtls' }
}
EOF
autocmd BufEnter * lua require'completion'.on_attach()

@ -31,6 +31,7 @@ case "$file" in
*\.m) octave -qW "$file" ;;
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
*config.h) sudo make install ;;
*\.java) java "$file" ;;
*\.js) node "$file" ;;
*\.c) if [ -f Makefile ]; then make run; else cc "$file" -o "$base" && "$base"; fi ;;
*\.nim) nim c -r -d:noColors "$file" ;;

@ -41,6 +41,7 @@ export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
# java
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk"
export _JAVA_AWT_WM_NONREPARENTING=1
export JDTLS_HOME="/usr/share/java/jdtls"
# golang
export GOPATH="${HOME}/code/go"

Loading…
Cancel
Save