Skip to content
Closed

sync #1817

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
749 changes: 96 additions & 653 deletions init.lua

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lua/config/diagnostic.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vim.diagnostic.config({ virtual_lines = true })
22 changes: 22 additions & 0 deletions lua/config/filetypes.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- Filetype detection configuration
-- This file ensures proper filetype detection for various languages

-- Kotlin filetype detection
vim.filetype.add({
extension = {
kt = 'kotlin',
kts = 'kotlin',
},
pattern = {
['.*%.kt$'] = 'kotlin',
['.*%.kts$'] = 'kotlin',
},
})

-- Ensure treesitter highlights are applied
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'kotlin', 'java' },
callback = function()
vim.treesitter.start()
end,
})
34 changes: 34 additions & 0 deletions lua/config/lspconfig.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- LSP configuration for Kotlin and Java with Maven support
-- This file contains LSP server configurations that are loaded on startup

return function()
-- Kotlin LSP configuration (Official Kotlin LSP)
vim.lsp.config('kotlin_language_server', {
filetypes = { 'kotlin' },
root_markers = {
'pom.xml',
'build.gradle',
'build.gradle.kts',
'settings.gradle',
'settings.gradle.kts'
},
single_file_support = true,
})
vim.lsp.enable('kotlin_language_server')

vim.lsp.set_log_level("debug")

-- Java LSP configuration
vim.lsp.config('jdtls', {
filetypes = { 'java' },
root_markers = {
'pom.xml',
'build.gradle',
'build.gradle.kts',
'.git'
},
single_file_support = true,

})
vim.lsp.enable('jdtls')
end
5 changes: 0 additions & 5 deletions lua/custom/plugins/init.lua

This file was deleted.

52 changes: 0 additions & 52 deletions lua/kickstart/health.lua

This file was deleted.

25 changes: 0 additions & 25 deletions lua/kickstart/plugins/neo-tree.lua

This file was deleted.

File renamed without changes.
65 changes: 65 additions & 0 deletions lua/plugins/cmp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
-- Autocompletion configuration (nvim-cmp + LuaSnip)
return {
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
dependencies = {
{
'L3MON4D3/LuaSnip',
build = (function()
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- Optionally load community snippets
-- 'rafamadriz/friendly-snippets',
},
},
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
},
config = function()
local cmp = require 'cmp'
local luasnip = require 'luasnip'
luasnip.config.setup {}

cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
completion = { completeopt = 'menu,menuone,noinsert' },
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<Enter>'] = cmp.mapping.confirm { select = true },
['<Tab>'] = cmp.mapping.confirm { select = true },
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-y>'] = cmp.mapping.confirm { select = true },
['<C-Space>'] = cmp.mapping.complete {},
['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
},
sources = {
{ name = 'lazydev', group_index = 0 },
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
},
}
end,
}


32 changes: 32 additions & 0 deletions lua/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- Kanagawa colorscheme configuration
return {
"rebelot/kanagawa.nvim",
config = function()
require('kanagawa').setup({
-- Available modes: 'wave', 'lotus', 'dragon'
-- 'wave' - Default, balanced colors
-- 'lotus' - Lighter, more pastel colors
-- 'dragon' - Darker, more vibrant colors
theme = "wave", -- Change this to 'lotus' or 'dragon' for different modes

-- Additional options
transparent = false,
terminal_colors = true,
colors = {
-- You can override specific colors here if needed
-- palette = {},
-- theme = {},
},
overrides = function(colors)
return {
-- Custom overrides can go here
}
end,
})

-- Set the colorscheme
vim.cmd("colorscheme kanagawa")
end,
}


34 changes: 34 additions & 0 deletions lua/plugins/conform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- Autoformat with conform.nvim
return {
'stevearc/conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
local disable_filetypes = { c = true, cpp = true }
local lsp_format_opt
if disable_filetypes[vim.bo[bufnr].filetype] then
lsp_format_opt = 'never'
else
lsp_format_opt = 'fallback'
end
return { timeout_ms = 500, lsp_format = lsp_format_opt }
end,
formatters_by_ft = {
lua = { 'stylua' },
},
},
}


File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions lua/plugins/java.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Java support aggregator
return {
'nvim-java/nvim-java',
}


12 changes: 12 additions & 0 deletions lua/plugins/lazydev.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Lua LSP enhancements for Neovim config/runtime/plugins
return {
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
},
},
}


File renamed without changes.
28 changes: 28 additions & 0 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
return {
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
},
config = function()
require('mason').setup()
require('mason-lspconfig').setup({
ensure_installed = { 'kotlin_language_server', 'jdtls' },
automatic_installation = true,
handlers = {
-- Default handler for all servers
function(server_name)
vim.lsp.config(server_name, {})
end,
-- Custom handler for specific servers
kotlin_language_server = function()
require('config.lspconfig')()
end,
jdtls = function()
require('config.lspconfig')()
end,
}
})
end,
}

11 changes: 11 additions & 0 deletions lua/plugins/lualine.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup({
options = {
theme = "tomorrow_night",
}
})
end
}
16 changes: 16 additions & 0 deletions lua/plugins/mini.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Collection of various small independent plugins/modules from mini.nvim
return {
'echasnovski/mini.nvim',
config = function()
require('mini.ai').setup { n_lines = 500 }
require('mini.surround').setup()
local statusline = require 'mini.statusline'
statusline.setup { use_icons = vim.g.have_nerd_font }
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end
end,
}


40 changes: 40 additions & 0 deletions lua/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim

return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
lazy = false,
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '<leader>nn', ':Neotree toggle<CR>', desc = 'NeoTree toggle', silent = true },
{ '<leader>na', ':Neotree filesystem create<CR>', desc = 'NeoTree create file', silent = true },
{ '<leader>nd', ':Neotree filesystem create<CR>', desc= 'NeoTree create directory', silent = true },
},
opts = {
close_if_last_window = true,
filesystem = {
window = {
mappings = {
['a'] = 'add',
['A'] = 'add_directory',
['d'] = 'delete',
['r'] = 'rename',
['y'] = 'copy_to_clipboard',
['x'] = 'cut_to_clipboard',
['p'] = 'paste_from_clipboard',
['c'] = 'copy',
['m'] = 'move',
['q'] = 'close_window',
['R'] = 'refresh',
['?'] = 'show_help',
},
},
},
},
}
Loading
Loading