dap and removed java
This commit is contained in:
parent
1999612bf2
commit
d7d344af1b
@ -1,40 +1,22 @@
|
|||||||
-- Highlight yanked text
|
-- Highlight yanked text
|
||||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank()
|
vim.highlight.on_yank()
|
||||||
end,
|
end,
|
||||||
group = highlight_group,
|
group = highlight_group,
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Go to last cursor position when opening a file
|
-- Go to last cursor position when opening a file
|
||||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
callback = function()
|
callback = function()
|
||||||
local ft = vim.bo.filetype
|
local ft = vim.bo.filetype
|
||||||
if ft ~= "commit" and ft ~= "rebase" then
|
if ft ~= "commit" and ft ~= "rebase" then
|
||||||
local last_pos = vim.fn.line("'\"")
|
local last_pos = vim.fn.line("'\"")
|
||||||
if last_pos > 1 and last_pos <= vim.fn.line("$") then
|
if last_pos > 1 and last_pos <= vim.fn.line("$") then
|
||||||
vim.cmd('normal! g`"')
|
vim.cmd('normal! g`"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
|
||||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
|
||||||
callback = function(args)
|
|
||||||
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
|
||||||
-- Usually not needed if server supports "textDocument/willSaveWaitUntil".
|
|
||||||
if not client:supports_method('textDocument/willSaveWaitUntil')
|
|
||||||
and client:supports_method('textDocument/formatting') then
|
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
|
||||||
group = vim.api.nvim_create_augroup('my.lsp', { clear = false }),
|
|
||||||
buffer = args.buf,
|
|
||||||
callback = function()
|
|
||||||
vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
|
|||||||
@ -4,40 +4,3 @@ vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
|||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
||||||
|
|
||||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
|
||||||
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
|
||||||
-- is not what someone will guess without a bit more experience.
|
|
||||||
--
|
|
||||||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
|
||||||
-- or just use <C-\><C-n> to exit terminal mode
|
|
||||||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
|
||||||
|
|
||||||
-- TIP: Disable arrow keys in normal mode
|
|
||||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
|
||||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
|
||||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
|
||||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
|
||||||
|
|
||||||
-- Keybinds to make split navigation easier.
|
|
||||||
-- Use CTRL+<hjkl> to switch between windows
|
|
||||||
--
|
|
||||||
-- See `:help wincmd` for a list of all window commands
|
|
||||||
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
|
|
||||||
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
|
|
||||||
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
|
||||||
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
|
||||||
|
|
||||||
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
|
||||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
|
||||||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
|
||||||
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
|
||||||
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
|
||||||
|
|
||||||
-- DAP keymaps
|
|
||||||
vim.keymap.set("n", "<leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", { desc = "Toggle [B]reakpoint" })
|
|
||||||
vim.keymap.set("n", "<leader>dc", "<cmd>lua require'dap'.continue()<CR>", { desc = "[C]ontinue" })
|
|
||||||
vim.keymap.set("n", "<leader>di", "<cmd>lua require'dap'.step_into()<CR>", { desc = "Step [I]nto" })
|
|
||||||
vim.keymap.set("n", "<leader>do", "<cmd>lua require'dap'.step_over()<CR>", { desc = "Step [O]ver" })
|
|
||||||
vim.keymap.set("n", "<leader>dO", "<cmd>lua require'dap'.step_out()<CR>", { desc = "Step [O]ut" })
|
|
||||||
vim.keymap.set("n", "<leader>dr", "<cmd>lua require'dap'.repl.open()<CR>", { desc = "Open [R]EPL" })
|
|
||||||
|
|||||||
@ -3,33 +3,31 @@ vim.g.mapleader = " "
|
|||||||
vim.g.maplocalleader = " "
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
-- UI and appearance
|
-- UI and appearance
|
||||||
vim.o.termguicolors = true -- 24-bit colors in TUI
|
vim.o.termguicolors = true -- 24-bit colors in TUI
|
||||||
vim.o.cursorline = true -- highlight current line
|
vim.o.cursorline = true -- highlight current line
|
||||||
vim.o.number = true -- absolute line numbers
|
vim.o.number = true -- absolute line numbers
|
||||||
vim.o.relativenumber = true -- relative line numbers
|
vim.o.relativenumber = true -- relative line numbers
|
||||||
vim.o.signcolumn = "yes" -- always show signcolumn
|
vim.o.signcolumn = "yes" -- always show signcolumn
|
||||||
vim.o.colorcolumn = "100" -- visual column guide
|
vim.o.colorcolumn = "100" -- visual column guide
|
||||||
vim.o.winborder = "rounded" -- default floating window border
|
vim.o.winborder = "rounded" -- default floating window border
|
||||||
vim.o.cmdheight = 0 -- minimal command-line height (NVIM 0.10+)
|
vim.o.cmdheight = 0 -- minimal command-line height (NVIM 0.10+)
|
||||||
vim.o.conceallevel = 2 -- conceal in Markdown/jsonc when appropriate
|
vim.o.conceallevel = 2 -- conceal in Markdown/jsonc when appropriate
|
||||||
vim.o.foldlevel = 0 -- start with folds closed (Treesitter can open)
|
vim.o.foldlevel = 0 -- start with folds closed (Treesitter can open)
|
||||||
|
|
||||||
-- Splits
|
-- Splits
|
||||||
vim.o.splitright = true -- open vertical splits to the right
|
vim.o.splitright = true -- open vertical splits to the right
|
||||||
vim.o.splitbelow = true -- open horizontal splits below
|
vim.o.splitbelow = true -- open horizontal splits below
|
||||||
|
|
||||||
-- Editing behavior
|
-- Editing behavior
|
||||||
vim.o.wrap = false -- do not wrap lines by default
|
vim.o.wrap = false -- do not wrap lines by default
|
||||||
vim.o.breakindent = true -- keep indentation on wrapped lines (if wrap is enabled later)
|
vim.o.breakindent = true -- keep indentation on wrapped lines (if wrap is enabled later)
|
||||||
-- Sync clipboard between OS and Neovim.
|
-- Sync clipboard between OS and Neovim.
|
||||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||||
-- Remove this option if you want your OS clipboard to remain independent.
|
-- Remove this option if you want your OS clipboard to remain independent.
|
||||||
-- See `:help 'clipboard'`
|
-- See `:help 'clipboard'`
|
||||||
vim.schedule(function()
|
vim.o.clipboard = "unnamedplus"
|
||||||
vim.o.clipboard = "unnamedplus"
|
vim.o.swapfile = false -- no swapfiles
|
||||||
end)
|
vim.o.undofile = true -- persistent undo
|
||||||
vim.o.swapfile = false -- no swapfiles
|
|
||||||
vim.o.undofile = true -- persistent undo
|
|
||||||
vim.o.writebackup = false -- do not keep backup around
|
vim.o.writebackup = false -- do not keep backup around
|
||||||
|
|
||||||
-- Tabs and indentation (2-space default; override per-filetype with autocmds)
|
-- Tabs and indentation (2-space default; override per-filetype with autocmds)
|
||||||
@ -40,16 +38,16 @@ vim.o.shiftwidth = 2
|
|||||||
|
|
||||||
-- Search
|
-- Search
|
||||||
vim.o.ignorecase = true -- case-insensitive
|
vim.o.ignorecase = true -- case-insensitive
|
||||||
vim.o.smartcase = true -- unless uppercase is used
|
vim.o.smartcase = true -- unless uppercase is used
|
||||||
|
|
||||||
-- Completion UX (good defaults for omni and popup behavior)
|
-- Completion UX (good defaults for omni and popup behavior)
|
||||||
vim.o.completeopt = "menu,menuone,noinsert,noselect"
|
vim.o.completeopt = "menu,menuone,noinsert,noselect"
|
||||||
vim.o.shortmess = (vim.o.shortmess or "") .. "c" -- reduce completion messages
|
vim.o.shortmess = (vim.o.shortmess or "") .. "c" -- reduce completion messages
|
||||||
|
|
||||||
-- Performance and input timing
|
-- Performance and input timing
|
||||||
vim.o.timeoutlen = 300 -- mapped sequence timeout
|
vim.o.timeoutlen = 800 -- mapped sequence timeout
|
||||||
vim.o.updatetime = 250 -- faster CursorHold/diagnostic updates
|
vim.o.updatetime = 250 -- faster CursorHold/diagnostic updates
|
||||||
vim.o.scrolloff = 10 -- context lines around cursor
|
vim.o.scrolloff = 10 -- context lines around cursor
|
||||||
|
|
||||||
-- Fonts/icons (used by statuslines/UIs)
|
-- Fonts/icons (used by statuslines/UIs)
|
||||||
vim.g.have_nerd_font = true
|
vim.g.have_nerd_font = true
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-autopairs").setup({
|
require("nvim-autopairs").setup({
|
||||||
disable_filetype = { "TelescopePrompt", "vim" },
|
disable_filetype = { "TelescopePrompt", "vim" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ return { -- Autocompletion
|
|||||||
},
|
},
|
||||||
--- @module 'blink.cmp'
|
--- @module 'blink.cmp'
|
||||||
--- @type blink.cmp.Config
|
--- @type blink.cmp.Config
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
keymap = {
|
keymap = {
|
||||||
-- set to 'none' to disable the 'default' preset
|
-- set to 'none' to disable the 'default' preset
|
||||||
@ -38,10 +39,10 @@ return { -- Autocompletion
|
|||||||
["<C-j>"] = { "select_next", "fallback" },
|
["<C-j>"] = { "select_next", "fallback" },
|
||||||
["<C-b>"] = { "scroll_documentation_up", "fallback" },
|
["<C-b>"] = { "scroll_documentation_up", "fallback" },
|
||||||
["<C-f>"] = { "scroll_documentation_down", "fallback" },
|
["<C-f>"] = { "scroll_documentation_down", "fallback" },
|
||||||
["<Tab>"] = { "snippet_forward", "fallback" },
|
-- ["<Tab>"] = { "snippet_forward", "fallback" },
|
||||||
["<S-Tab>"] = { "snippet_backward", "fallback" },
|
-- ["<S-Tab>"] = { "snippet_backward", "fallback" },
|
||||||
-- ["<S-Tab>"] = { "select_prev", "fallback" },
|
["<S-Tab>"] = { "select_prev", "fallback" },
|
||||||
-- ["<Tab>"] = { "select_next", "fallback" },
|
["<Tab>"] = { "select_next", "fallback" },
|
||||||
|
|
||||||
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||||
["<CR>"] = { "select_and_accept", "fallback" },
|
["<CR>"] = { "select_and_accept", "fallback" },
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
return {
|
return {
|
||||||
"folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
opts = {
|
opts = {
|
||||||
signs = true,
|
signs = true,
|
||||||
keywords = {
|
keywords = {
|
||||||
TODO = { icon = "🤨", color = "info" },
|
TODO = { icon = "🤨", color = "info" },
|
||||||
WIP = { icon = "🥵", color = "warning" },
|
WIP = { icon = "🥵", color = "warning" },
|
||||||
ERR = { icon = "🤬", color = "error" },
|
ERROR = { icon = "🤬", color = "error" },
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
56
nvim/lua/kanopo/plugins/dap.lua
Normal file
56
nvim/lua/kanopo/plugins/dap.lua
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
return {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
local dapui = require("dapui")
|
||||||
|
|
||||||
|
dapui.setup()
|
||||||
|
require("nvim-dap-virtual-text").setup({})
|
||||||
|
|
||||||
|
local map = function(keys, func, desc)
|
||||||
|
vim.keymap.set("n", keys, func, { desc = "DAP: " .. desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
map("<leader>db", dap.toggle_breakpoint, "Toggle [B]reakpoint")
|
||||||
|
map("<leader>dc", dap.continue, "[C]ontinue")
|
||||||
|
map("<leader>di", dap.step_into, "Step [I]nto")
|
||||||
|
map("<leader>do", dap.step_over, "Step [O]ver")
|
||||||
|
map("<leader>dO", dap.step_out, "Step [O]ut")
|
||||||
|
map("<leader>dr", dap.repl.open, "Open [R]EPL")
|
||||||
|
map("<leader>dt", dap.terminate, "[T]erminate")
|
||||||
|
map("<leader>du", dapui.toggle, "Toggle [U]I")
|
||||||
|
|
||||||
|
local debuggers = {
|
||||||
|
delve = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
local ensure_installed = vim.tbl_keys(debuggers)
|
||||||
|
|
||||||
|
require("mason-nvim-dap").setup({
|
||||||
|
ensure_installed = ensure_installed,
|
||||||
|
automatic_installation = true,
|
||||||
|
handlers = {
|
||||||
|
function(config)
|
||||||
|
require("mason-nvim-dap").default_setup(config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
"stevearc/dressing.nvim",
|
"stevearc/dressing.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
inputs = {
|
inputs = {
|
||||||
enable = true,
|
enable = true,
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +1,40 @@
|
|||||||
|
return { -- Autoformat
|
||||||
return { -- Autoformat
|
"stevearc/conform.nvim",
|
||||||
"stevearc/conform.nvim",
|
event = { "BufWritePre" },
|
||||||
event = { "BufWritePre" },
|
cmd = { "ConformInfo" },
|
||||||
cmd = { "ConformInfo" },
|
keys = {
|
||||||
keys = {
|
{
|
||||||
{
|
"<leader>f",
|
||||||
"<leader>f",
|
function()
|
||||||
function()
|
require("conform").format({ async = true, lsp_format = "fallback" })
|
||||||
require("conform").format({ async = true, lsp_format = "fallback" })
|
|
||||||
end,
|
|
||||||
mode = "",
|
|
||||||
desc = "[F]ormat buffer",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
notify_on_error = false,
|
|
||||||
format_on_save = function(bufnr)
|
|
||||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
|
||||||
-- have a well standardized coding style. You can add additional
|
|
||||||
-- languages here or re-enable it for the disabled ones.
|
|
||||||
local disable_filetypes = { c = true, cpp = true }
|
|
||||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
|
||||||
return nil
|
|
||||||
else
|
|
||||||
return {
|
|
||||||
timeout_ms = 500,
|
|
||||||
lsp_format = "fallback",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
mode = "",
|
||||||
lua = { "stylua" },
|
desc = "[F]ormat buffer",
|
||||||
-- Conform can also run multiple formatters sequentially
|
|
||||||
-- python = { "isort", "black" },
|
|
||||||
--
|
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
opts = {
|
||||||
|
notify_on_error = false,
|
||||||
|
format_on_save = function(bufnr)
|
||||||
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||||
|
-- have a well standardized coding style. You can add additional
|
||||||
|
-- languages here or re-enable it for the disabled ones.
|
||||||
|
local disable_filetypes = { c = true, cpp = true }
|
||||||
|
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||||
|
return nil
|
||||||
|
else
|
||||||
|
return {
|
||||||
|
timeout_ms = 500,
|
||||||
|
lsp_format = "fallback",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
-- Conform can also run multiple formatters sequentially
|
||||||
|
-- python = { "isort", "black" },
|
||||||
|
--
|
||||||
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|||||||
@ -1,16 +1,12 @@
|
|||||||
return {
|
return {
|
||||||
"NeogitOrg/neogit",
|
"NeogitOrg/neogit",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
},
|
},
|
||||||
-- config = function()
|
opts = true,
|
||||||
-- require("neogit").setup()
|
keys = {
|
||||||
-- vim.keymap.set("n", "<leader>gg", "<cmd>Neogit<cr>", { desc = "Neogit" })
|
{ "<leader>gg", "<cmd>Neogit<cr>", desc = "Neogit" },
|
||||||
-- end,
|
},
|
||||||
opts = true,
|
|
||||||
keys = {
|
|
||||||
{ "<leader>gg", "<cmd>Neogit<cr>", desc = "Neogit" },
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
return {
|
|
||||||
"mfussenegger/nvim-jdtls",
|
|
||||||
ft = "java",
|
|
||||||
config = function()
|
|
||||||
local lombok_dir = vim.fn.stdpath("data") .. "/lombok"
|
|
||||||
local lombok_path = lombok_dir .. "/lombok.jar"
|
|
||||||
|
|
||||||
if not vim.loop.fs_stat(lombok_path) then
|
|
||||||
vim.fn.mkdir(lombok_dir, "p")
|
|
||||||
print("Downloading lombok.jar...")
|
|
||||||
local lombok_url = "https://projectlombok.org/downloads/lombok.jar"
|
|
||||||
vim.fn.system({ "curl", "-L", "-o", lombok_path, lombok_url })
|
|
||||||
print("lombok.jar downloaded to " .. lombok_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
|
||||||
|
|
||||||
local config = {
|
|
||||||
cmd = {
|
|
||||||
"jdtls",
|
|
||||||
"--jvm-arg=-javaagent:" .. lombok_path,
|
|
||||||
},
|
|
||||||
root_dir = vim.fs.root(0, { ".git", "mvnw", "gradlew" }) or vim.fn.getcwd(),
|
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
|
|
||||||
require("jdtls").start_or_attach(config)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@ -1,13 +1,12 @@
|
|||||||
|
return {
|
||||||
return {
|
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
-- used for completion, annotations and signatures of Neovim apis
|
||||||
-- used for completion, annotations and signatures of Neovim apis
|
"folke/lazydev.nvim",
|
||||||
"folke/lazydev.nvim",
|
ft = "lua",
|
||||||
ft = "lua",
|
opts = {
|
||||||
opts = {
|
library = {
|
||||||
library = {
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ return {
|
|||||||
"mason-org/mason-lspconfig.nvim",
|
"mason-org/mason-lspconfig.nvim",
|
||||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||||
|
|
||||||
{ "j-hui/fidget.nvim", opts = {} },
|
{ "j-hui/fidget.nvim", opts = {} },
|
||||||
|
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
},
|
},
|
||||||
@ -13,6 +13,8 @@ return {
|
|||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
|
|
||||||
local map = function(keys, func, desc, mode)
|
local map = function(keys, func, desc, mode)
|
||||||
mode = mode or "n"
|
mode = mode or "n"
|
||||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||||
@ -61,7 +63,7 @@ return {
|
|||||||
-- code, if the language server you are using supports them
|
-- code, if the language server you are using supports them
|
||||||
--
|
--
|
||||||
-- This may be unwanted, since they displace some of your code
|
-- This may be unwanted, since they displace some of your code
|
||||||
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
||||||
map("<leader>th", function()
|
map("<leader>th", function()
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||||
end, "[T]oggle Inlay [H]ints")
|
end, "[T]oggle Inlay [H]ints")
|
||||||
@ -98,28 +100,11 @@ return {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
|
||||||
-- By default, Neovim doesn't support everything that is in the LSP specification.
|
|
||||||
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
|
||||||
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
|
||||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||||
|
|
||||||
-- Enable the following language servers
|
|
||||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
|
||||||
--
|
|
||||||
-- Add any additional override configuration in the following tables. Available keys are:
|
|
||||||
-- - cmd (table): Override the default command used to start the server
|
|
||||||
-- - filetypes (table): Override the default list of associated filetypes for the server
|
|
||||||
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
|
||||||
-- - 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 = {
|
local servers = {
|
||||||
texlab = {},
|
|
||||||
rust_analyzer = {},
|
|
||||||
cssls = {},
|
cssls = {},
|
||||||
astro = {},
|
|
||||||
tailwindcss = {},
|
tailwindcss = {},
|
||||||
pylsp = {},
|
|
||||||
ts_ls = {},
|
ts_ls = {},
|
||||||
gopls = {},
|
gopls = {},
|
||||||
postgres_lsp = {},
|
postgres_lsp = {},
|
||||||
@ -129,45 +114,24 @@ return {
|
|||||||
completion = {
|
completion = {
|
||||||
callSnippet = "Replace",
|
callSnippet = "Replace",
|
||||||
},
|
},
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Ensure the servers and tools above are installed
|
|
||||||
--
|
|
||||||
-- To check the current status of installed tools and/or manually install
|
|
||||||
-- other tools, you can run
|
|
||||||
-- :Mason
|
|
||||||
--
|
|
||||||
-- You can press `g?` for help in this menu.
|
|
||||||
--
|
|
||||||
-- `mason` had to be setup earlier: to configure its options see the
|
|
||||||
-- `dependencies` table for `nvim-lspconfig` above.
|
|
||||||
--
|
|
||||||
-- You can add other tools here that you want Mason to install
|
|
||||||
-- for you, so that they are available from within Neovim.
|
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
"stylua", -- Used to format Lua code
|
"stylua", -- Used to format Lua code
|
||||||
})
|
})
|
||||||
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
||||||
|
|
||||||
require("mason-lspconfig").setup({
|
for server_name, server in pairs(servers) do
|
||||||
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
-- This handles overriding only values explicitly passed
|
||||||
automatic_installation = true,
|
-- by the server configuration above. Useful when disabling
|
||||||
handlers = {
|
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||||
function(server_name)
|
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||||
local server = servers[server_name] or {}
|
vim.lsp.config(server_name, server)
|
||||||
-- This handles overriding only values explicitly passed
|
vim.lsp.enable(server_name)
|
||||||
-- by the server configuration above. Useful when disabling
|
end
|
||||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
|
||||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
|
||||||
require("lspconfig")[server_name].setup(server)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
'stevearc/oil.nvim',
|
"stevearc/oil.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
config = function()
|
config = function()
|
||||||
require("oil").setup()
|
require("oil").setup()
|
||||||
vim.keymap.set('n', '<leader>fe', "<cmd>:Oil<cr>")
|
vim.keymap.set("n", "<leader>fe", "<cmd>:Oil<cr>")
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
"ellisonleao/gruvbox.nvim",
|
"ellisonleao/gruvbox.nvim",
|
||||||
priority = 1000 ,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
vim.o.background = "dark" -- or "light" for light mode
|
vim.o.background = "dark" -- or "light" for light mode
|
||||||
vim.cmd([[colorscheme gruvbox]])
|
vim.cmd([[colorscheme gruvbox]])
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,52 +1,19 @@
|
|||||||
return { -- Useful plugin to show you pending keybinds.
|
return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
event = "VimEnter", -- Sets the loading event to 'VimEnter'
|
event = "VimEnter",
|
||||||
opts = {
|
opts = {
|
||||||
-- delay between pressing a key and opening which-key (milliseconds)
|
delay = 0,
|
||||||
-- this setting is independent of vim.o.timeoutlen
|
icons = {
|
||||||
delay = 0,
|
-- set icon mappings to true if you have a Nerd Font
|
||||||
icons = {
|
mappings = vim.g.have_nerd_font,
|
||||||
-- set icon mappings to true if you have a Nerd Font
|
|
||||||
mappings = vim.g.have_nerd_font,
|
|
||||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
|
||||||
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
|
||||||
keys = vim.g.have_nerd_font and {} or {
|
|
||||||
Up = "<Up> ",
|
|
||||||
Down = "<Down> ",
|
|
||||||
Left = "<Left> ",
|
|
||||||
Right = "<Right> ",
|
|
||||||
C = "<C-…> ",
|
|
||||||
M = "<M-…> ",
|
|
||||||
D = "<D-…> ",
|
|
||||||
S = "<S-…> ",
|
|
||||||
CR = "<CR> ",
|
|
||||||
Esc = "<Esc> ",
|
|
||||||
ScrollWheelDown = "<ScrollWheelDown> ",
|
|
||||||
ScrollWheelUp = "<ScrollWheelUp> ",
|
|
||||||
NL = "<NL> ",
|
|
||||||
BS = "<BS> ",
|
|
||||||
Space = "<Space> ",
|
|
||||||
Tab = "<Tab> ",
|
|
||||||
F1 = "<F1>",
|
|
||||||
F2 = "<F2>",
|
|
||||||
F3 = "<F3>",
|
|
||||||
F4 = "<F4>",
|
|
||||||
F5 = "<F5>",
|
|
||||||
F6 = "<F6>",
|
|
||||||
F7 = "<F7>",
|
|
||||||
F8 = "<F8>",
|
|
||||||
F9 = "<F9>",
|
|
||||||
F10 = "<F10>",
|
|
||||||
F11 = "<F11>",
|
|
||||||
F12 = "<F12>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Document existing key chains
|
|
||||||
spec = {
|
|
||||||
{ "<leader>s", group = "[S]earch" },
|
|
||||||
{ "<leader>t", group = "[T]oggle" },
|
|
||||||
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
-- Document existing key chains
|
||||||
|
spec = {
|
||||||
|
{ "<leader>s", group = "[S]earch" },
|
||||||
|
{ "<leader>t", group = "[T]oggle" },
|
||||||
|
{ "<leader>d", group = "[D]ebug" },
|
||||||
|
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user