new lua style
This commit is contained in:
@ -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',
|
||||
|
Reference in New Issue
Block a user