trying to fix auto indenting on some files part 4?
This commit is contained in:
parent
1b1e2947f6
commit
1cd72c0f25
|
@ -28,6 +28,7 @@ return {
|
|||
"clangd",
|
||||
"pyright",
|
||||
"nixd",
|
||||
"ruff_lsp",
|
||||
-- Add other servers like "bashls", "yamlls", "gopls", "rust_analyzer" etc.
|
||||
-- Ensure the corresponding packages (e.g., pkgs.bash-language-server)
|
||||
-- are in your Home Manager home.packages list.
|
||||
|
@ -74,15 +75,24 @@ return {
|
|||
end
|
||||
end
|
||||
if client and client_supports_method(client, 'textDocument/documentHighlight', event.buf) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight-override', { clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, group = highlight_augroup, callback = vim.lsp.buf.document_highlight })
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { buffer = event.buf, group = highlight_augroup, callback = vim.lsp.buf.clear_references })
|
||||
vim.api.nvim_create_autocmd('LspDetach', { group = vim.api.nvim_create_augroup('kickstart-lsp-detach-override', { clear = true }), callback = function(event2) vim.lsp.buf.clear_references(); vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight-override', buffer = event2.buf } end })
|
||||
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight-override',
|
||||
{ clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' },
|
||||
{ buffer = event.buf, group = highlight_augroup, callback = vim.lsp.buf.document_highlight })
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' },
|
||||
{ buffer = event.buf, group = highlight_augroup, callback = vim.lsp.buf.clear_references })
|
||||
vim.api.nvim_create_autocmd('LspDetach',
|
||||
{ group = vim.api.nvim_create_augroup('kickstart-lsp-detach-override', { clear = true }), callback = function(
|
||||
event2)
|
||||
vim.lsp.buf.clear_references(); vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight-override', buffer = event2.buf }
|
||||
end })
|
||||
end
|
||||
|
||||
-- Inlay hints toggle
|
||||
if client and client_supports_method(client, 'textDocument/inlayHint', event.buf) then
|
||||
map('<leader>th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints')
|
||||
map('<leader>th',
|
||||
function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end,
|
||||
'[T]oggle Inlay [H]ints')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -100,12 +110,13 @@ return {
|
|||
virtual_text = {
|
||||
source = 'if_many', spacing = 2,
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = { [vim.diagnostic.severity.ERROR] = diagnostic.message, [vim.diagnostic.severity.WARN] = diagnostic.message, [vim.diagnostic.severity.INFO] = diagnostic.message, [vim.diagnostic.severity.HINT] = diagnostic.message }
|
||||
local diagnostic_message = { [vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message, [vim.diagnostic.severity.INFO] =
|
||||
diagnostic.message, [vim.diagnostic.severity.HINT] = diagnostic.message }
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
end, -- End of config function
|
||||
},
|
||||
|
||||
|
@ -118,4 +129,3 @@ return {
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue