update kotlin

This commit is contained in:
Abdullah Bodur 2025-02-25 12:37:07 +01:00
parent bc6fb494a0
commit dc702eb41a
1 changed files with 43 additions and 18 deletions

View File

@ -628,7 +628,13 @@ require('lazy').setup({
-- 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 = {},
-- --
kotlin_language_server = {
cmd = { vim.fn.stdpath 'data' .. '/mason/bin/kotlin-language-server' },
filetypes = { 'kotlin' },
root_dir = require('lspconfig').util.root_pattern('settings.gradle', 'settings.gradle.kts', 'build.gradle', 'build.gradle.kts', '.git')
or vim.fn.getcwd(),
capabilities = require('cmp_nvim_lsp').default_capabilities(),
},
lua_ls = { lua_ls = {
-- cmd = { ... }, -- cmd = { ... },
-- filetypes = { ... }, -- filetypes = { ... },
@ -665,6 +671,7 @@ require('lazy').setup({
require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-tool-installer').setup { ensure_installed = ensure_installed }
require('java').setup() require('java').setup()
require('lspconfig').jdtls.setup {} require('lspconfig').jdtls.setup {}
require('lspconfig').kotlin_language_server.setup {}
require('mason-lspconfig').setup { require('mason-lspconfig').setup {
handlers = { handlers = {
function(server_name) function(server_name)
@ -784,7 +791,10 @@ require('lazy').setup({
['<C-n>'] = cmp.mapping.select_next_item(), ['<C-n>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item -- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(), ['<C-p>'] = cmp.mapping.select_prev_item(),
-- Confirm the suggestion
['<Enter>'] = cmp.mapping.confirm { select = true },
-- Also confirm with Tab
['<Tab>'] = cmp.mapping.confirm { select = true },
-- Scroll the documentation window [b]ack / [f]orward -- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
@ -840,25 +850,40 @@ require('lazy').setup({
} }
end, end,
}, },
{
'Mofiqul/vscode.nvim',
{ -- You can easily change to a different colorscheme. -- optionally, override the default options:
-- Change the name of the colorscheme plugin below, and then config = function()
-- change the command in the config to whatever the name of that colorscheme is. local c = require('vscode.colors').get_colors()
-- require('vscode').setup {
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. -- Alternatively set style in setup
'folke/tokyonight.nvim', -- style = 'light'
priority = 1000, -- Make sure to load this before all the other start plugins.
init = function()
-- 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'
-- You can configure highlights by doing something like: -- Enable transparent background
vim.cmd.hi 'Comment gui=none' transparent = false,
end,
-- Enable italic comment
italic_comments = true,
-- Disable nvim-tree background color
disable_nvimtree_bg = true,
-- Override colors (see ./lua/vscode/colors.lua)
color_overrides = {
vscLineNumber = '#FFFFFF',
}, },
-- Override highlight groups (see ./lua/vscode/theme.lua)
group_overrides = {
-- this supports the same val table as vim.api.nvim_set_hl
-- use colors from this colorscheme by requiring vscode.colors!
Cursor = { fg = c.vscDarkBlue, bg = c.vscLightGreen, bold = true },
},
}
require('vscode').load()
end,
},
-- Highlight todo, notes, etc in comments -- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
@ -905,7 +930,7 @@ require('lazy').setup({
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', 'java' }, ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'java', 'kotlin' },
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {