added java tls

This commit is contained in:
2025-09-12 15:02:47 +02:00
parent f2309053c7
commit d9807a35b5
5 changed files with 47 additions and 17 deletions

View File

@@ -91,7 +91,12 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal -- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false vim.g.have_nerd_font = true
vim.o.tabstop = 4 -- A TAB character looks like 4 spaces
vim.o.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character
vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character
vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting
-- [[ Setting options ]] -- [[ Setting options ]]
require 'options' require 'options'

View File

@@ -1,9 +0,0 @@
return {
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
opts = {},
},
}

View File

@@ -22,6 +22,7 @@ return {
{ 'mason-org/mason.nvim', opts = {} }, { 'mason-org/mason.nvim', opts = {} },
'mason-org/mason-lspconfig.nvim', 'mason-org/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim',
'nvim-java/nvim-java',
-- Useful status updates for LSP. -- Useful status updates for LSP.
{ 'j-hui/fidget.nvim', opts = {} }, { 'j-hui/fidget.nvim', opts = {} },
@@ -208,10 +209,10 @@ return {
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = { local servers = {
-- clangd = {}, clangd = {},
-- gopls = {}, gopls = {},
-- pyright = {}, pyright = {},
-- rust_analyzer = {}, rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --
-- Some languages (like typescript) have entire language plugins that can be useful: -- Some languages (like typescript) have entire language plugins that can be useful:
@@ -220,7 +221,7 @@ return {
-- But for many setups, the LSP (`ts_ls`) will work just fine -- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {}, -- ts_ls = {},
-- --
--
lua_ls = { lua_ls = {
-- cmd = { ... }, -- cmd = { ... },
-- filetypes = { ... }, -- filetypes = { ... },
@@ -237,6 +238,22 @@ return {
}, },
} }
require('java').setup {
-- Your custom jdtls settings goes here
}
require('lspconfig').jdtls.setup {
-- Your custom nvim-java configuration goes here
}
-- The following loop will configure each server with the capabilities we defined above.
-- This will ensure that all servers have the same base configuration, but also
-- allow for server-specific overrides.
for server_name, server_config in pairs(servers) do
server_config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server_config.capabilities or {})
require('lspconfig')[server_name].setup(server_config)
end
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
-- --
-- To check the current status of installed tools and/or manually install -- To check the current status of installed tools and/or manually install

View File

@@ -17,7 +17,7 @@ return {
-- Load the colorscheme here. -- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load -- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night' vim.cmd.colorscheme 'tokyonight-day'
end, end,
}, },
} }

View File

@@ -5,7 +5,24 @@ return {
main = 'nvim-treesitter.configs', -- Sets main module to use for opts main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, ensure_installed = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'rust',
'go',
'html',
'javascript',
'python',
},
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {