Added java LSP
This commit is contained in:
@@ -39,6 +39,7 @@ Plug 'hrsh7th/nvim-cmp', {'branch': 'main'}
|
|||||||
Plug 'ray-x/lsp_signature.nvim'
|
Plug 'ray-x/lsp_signature.nvim'
|
||||||
|
|
||||||
" Autocompletion snippets
|
" Autocompletion snippets
|
||||||
|
Plug 'hrsh7th/cmp-vsnip', {'branch': 'main'}
|
||||||
Plug 'hrsh7th/vim-vsnip'
|
Plug 'hrsh7th/vim-vsnip'
|
||||||
|
|
||||||
" More syntax
|
" More syntax
|
||||||
@@ -181,6 +182,11 @@ lspconfig.rust_analyzer.setup {
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lspconfig.java_language_server.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
cmd = {"/usr/share/java/java-language-server/lang_server_linux.sh"},
|
||||||
|
}
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
virtual_text = true,
|
virtual_text = true,
|
||||||
@@ -190,6 +196,9 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
|||||||
)
|
)
|
||||||
END
|
END
|
||||||
|
|
||||||
|
" Enable type inlay hints
|
||||||
|
autocmd CursorHold,CursorHoldI *.rs :lua require'lsp_extensions'.inlay_hints{ only_current_line = true }
|
||||||
|
|
||||||
" Rustfmt config
|
" Rustfmt config
|
||||||
let g:rustfmt_autosave = 1
|
let g:rustfmt_autosave = 1
|
||||||
let g:rustfmt_emit_files = 1
|
let g:rustfmt_emit_files = 1
|
||||||
@@ -227,6 +236,7 @@ set shiftwidth=2
|
|||||||
" Normal mouse behavior
|
" Normal mouse behavior
|
||||||
set mouse=a
|
set mouse=a
|
||||||
|
|
||||||
|
|
||||||
" True-color support: https://github.com/morhetz/gruvbox/wiki/Terminal-specific#0-recommended-neovimvim-true-color-support
|
" True-color support: https://github.com/morhetz/gruvbox/wiki/Terminal-specific#0-recommended-neovimvim-true-color-support
|
||||||
if (has("termguicolors"))
|
if (has("termguicolors"))
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
|||||||
Reference in New Issue
Block a user