new lua style

This commit is contained in:
2025-04-17 21:58:34 +02:00
parent 92ec6976c5
commit 8b99910bb4
26 changed files with 109 additions and 583 deletions

View File

@ -6,23 +6,17 @@ return {
server = {
on_attach = function(client, bufnr)
local options = { noremap = true, silent = false, buffer = bufnr }
vim.keymap.set('n', '<space>y', function()
vim.cmd.RustLsp({ 'hover', 'actions' })
end, vim.tbl_extend('error', options, { desc = 'Hover' }))
vim.keymap.set('n', '<space>y', function() vim.cmd.RustLsp({ 'hover', 'actions' }) end, vim.tbl_extend('error', options, { desc = 'Hover' }))
local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
callback = function()
vim.lsp.buf.document_highlight()
end,
callback = function() vim.lsp.buf.document_highlight() end,
buffer = bufnr,
group = group,
desc = 'Document Highlight',
})
vim.api.nvim_create_autocmd('CursorMoved', {
callback = function()
vim.lsp.buf.clear_references()
end,
callback = function() vim.lsp.buf.clear_references() end,
buffer = bufnr,
group = group,
desc = 'Clear All the References',