added format on save and go to error keybind
This commit is contained in:
parent
22540294a8
commit
a78e6db309
1 changed files with 24 additions and 18 deletions
|
@ -28,7 +28,13 @@ local on_attach = function(client, bufnr)
|
|||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
vim.keymap.set('n', '<space>ge', function () vim.diagnostic.goto_next() end, bufopts)
|
||||
vim.keymap.set('n', '<space>gE', function () vim.diagnostic.goto_prev() end, bufopts)
|
||||
vim.keymap.set('n', '<space>fo', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
pattern = '<buffer>',
|
||||
callback = function() vim.lsp.buf.format({ async = true }) end
|
||||
})
|
||||
end
|
||||
|
||||
local lsp = require "lspconfig"
|
||||
|
|
Loading…
Reference in a new issue