From d9807a35b5c2cb646076ce7a824b79391f4a84f8 Mon Sep 17 00:00:00 2001 From: htom Date: Fri, 12 Sep 2025 15:02:47 +0200 Subject: [PATCH] added java tls --- init.lua | 7 ++++++- lua/kickstart/plugins/indent_line.lua | 9 --------- lua/kickstart/plugins/lspconfig.lua | 27 ++++++++++++++++++++++----- lua/kickstart/plugins/tokyonight.lua | 2 +- lua/kickstart/plugins/treesitter.lua | 19 ++++++++++++++++++- 5 files changed, 47 insertions(+), 17 deletions(-) delete mode 100644 lua/kickstart/plugins/indent_line.lua diff --git a/init.lua b/init.lua index 3784c1a..6f86224 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,12 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- 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 ]] require 'options' diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua deleted file mode 100644 index ed7f269..0000000 --- a/lua/kickstart/plugins/indent_line.lua +++ /dev/null @@ -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 = {}, - }, -} diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 6532757..666ab12 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -22,6 +22,7 @@ return { { 'mason-org/mason.nvim', opts = {} }, 'mason-org/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', + 'nvim-java/nvim-java', -- Useful status updates for LSP. { 'j-hui/fidget.nvim', opts = {} }, @@ -208,10 +209,10 @@ return { -- - 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/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, + clangd = {}, + gopls = {}, + pyright = {}, + rust_analyzer = {}, -- ... 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: @@ -220,7 +221,7 @@ return { -- But for many setups, the LSP (`ts_ls`) will work just fine -- ts_ls = {}, -- - + -- lua_ls = { -- cmd = { ... }, -- 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 -- -- To check the current status of installed tools and/or manually install diff --git a/lua/kickstart/plugins/tokyonight.lua b/lua/kickstart/plugins/tokyonight.lua index 1b32f79..25d850e 100644 --- a/lua/kickstart/plugins/tokyonight.lua +++ b/lua/kickstart/plugins/tokyonight.lua @@ -17,7 +17,7 @@ return { -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'tokyonight-day' end, }, } diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index b026245..bff9d6f 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -5,7 +5,24 @@ return { main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` 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 auto_install = true, highlight = {