This commit is contained in:
hexlocation 2025-07-23 19:38:50 +02:00
parent d7b96fb86c
commit 87f7485642
8 changed files with 134 additions and 187 deletions

View file

@ -3,6 +3,14 @@ local fidget = require('fidget')
local nlcmp = require('cmp_nvim_lsp')
local cmp = require('cmp')
local map = vim.keymap.set
--[[
local jdtls = require('jdtls')
jdtls.start_or_attach({
cmd = { '/home/hex/Documents/dev/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/bin/jdtls' },
root_dir = vim.fs.dirname(vim.fs.find({ 'gradlew', '.git', 'mvnw' }, { upward = true })[1]),
})
--]]
vim.opt.signcolumn = 'yes'
@ -16,7 +24,7 @@ lc_defaults.capabilities = vim.tbl_deep_extend(
cmp.setup({
sources = {
{ name = 'nvim_lsp' },
{ name = 'buffer', keyword_length = 3 }, -- only start autocompleting after a few chars typed
{ name = 'buffer', keyword_length = 3 }, -- only start autocompleting after a few chars typed
},
snippet = {
expand = function(args)
@ -37,7 +45,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions (apparently)',
callback = function(event)
fidget.notify("LSP attached to current buffer.", nil, nil)
local opts = { buffer = event.buf }
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
@ -45,6 +53,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
map('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
map('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
map('n', 'gf', '<cmd>lua vim.lsp.buf.format({async = false, timeout_ms = 10000})<cr>', opts)
map("n", "<leader>r", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
end,
})