updates
This commit is contained in:
1 parent
3d10435374
commit
1d77c215ea
3 files changed
+61
-12
No files matched your search
@@ -60,6 +60,8 @@ return { {
|
||||
vim.opt.signcolumn = 'yes'
|
||||
end,
|
||||
config = function()
|
||||
vim.diagnostic.config({ update_in_insert = true })
|
||||
|
||||
-- Add cmp_nvim_lsp capabilities settings to lspconfig
|
||||
-- This should be executed before you configure any language server
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
@@ -76,7 +78,7 @@ return { {
|
||||
group = group,
|
||||
buffer = bufnr
|
||||
})
|
||||
|
||||
--[[ Disable for now the format on save so it does not fuck up other shit
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
buffer = bufnr,
|
||||
group = group,
|
||||
@@ -89,6 +91,7 @@ return { {
|
||||
})
|
||||
end
|
||||
})
|
||||
--]]
|
||||
end
|
||||
|
||||
-- LspAttach is where you enable features that only work
|
||||
@@ -103,7 +106,7 @@ return { {
|
||||
return
|
||||
end
|
||||
|
||||
if client.supports_method('textDocument/formatting') then
|
||||
if client:supports_method('textDocument/formatting') then
|
||||
buffer_autoformat(event.buf)
|
||||
end
|
||||
|
||||
@@ -203,5 +206,45 @@ return { {
|
||||
})
|
||||
|
||||
vim.lsp.enable('sourcekit')
|
||||
|
||||
-- kotlin-lsp (JetBrains) — not auto-handled by mason-lspconfig
|
||||
-- The pre-alpha EAP build has an expiry baked in, so we launch it under
|
||||
-- `faketime` pinned to a date within its valid window.
|
||||
-- Requires: `brew install libfaketime` (provides the `faketime` binary).
|
||||
vim.lsp.config('kotlin_lsp', {
|
||||
capabilities = capabilities,
|
||||
cmd = { 'faketime', '2026-06-04', 'kotlin-lsp', '--stdio' },
|
||||
})
|
||||
vim.lsp.enable('kotlin_lsp')
|
||||
|
||||
-- Ruby LSP — uses the GLOBAL `ruby-lsp` gem, NOT a Gemfile entry. When
|
||||
-- launched in a project it builds its own "composed bundle" under
|
||||
-- .ruby-lsp/ that layers ruby-lsp on top of the app's gems, so your
|
||||
-- Gemfile stays untouched (this is what the ruby-lsp maintainers
|
||||
-- recommend). We inherit lspconfig's default cmd, which runs `ruby-lsp`
|
||||
-- (resolved from rbenv's PATH) with cwd = root_dir.
|
||||
-- Install once per Ruby you use, e.g.: gem install ruby-lsp (Ruby >= 3)
|
||||
vim.lsp.config('ruby_lsp', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
vim.lsp.enable('ruby_lsp')
|
||||
|
||||
-- Standalone RuboCop LSP, run from the project's bundle (rubocop is
|
||||
-- normally already in the Gemfile, so no change needed there).
|
||||
-- NOTE: ruby-lsp's composed bundle also auto-activates a RuboCop addon
|
||||
-- when rubocop is present, so running this too can produce duplicate
|
||||
-- diagnostics. Comment out the two lines below if you'd rather get
|
||||
-- RuboCop only through ruby-lsp.
|
||||
vim.lsp.config('rubocop', {
|
||||
capabilities = capabilities,
|
||||
cmd = function(dispatchers, config)
|
||||
return vim.lsp.rpc.start(
|
||||
{ 'bundle', 'exec', 'rubocop', '--lsp' },
|
||||
dispatchers,
|
||||
config and config.root_dir and { cwd = config.cmd_cwd or config.root_dir }
|
||||
)
|
||||
end,
|
||||
})
|
||||
vim.lsp.enable('rubocop')
|
||||
end
|
||||
} }
|
||||
@@ -26,5 +26,11 @@ return {
|
||||
silent = true,
|
||||
desc = "Toggle File Explorer"
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ef", ":NvimTreeFindFile<CR>", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
desc = "Find Current File in Explorer"
|
||||
})
|
||||
end
|
||||
}
|
||||
Reference in new issue
Block a user