fixed lsp code actions key binding in nvim configs

This commit is contained in:
Rudis Muiznieks 2022-06-09 18:00:28 -05:00
parent 50c6cf5e52
commit b1e56509f4
Signed by: rudism
GPG key ID: CABF2F86EF7884F9
3 changed files with 14 additions and 2 deletions

View file

@ -17,8 +17,7 @@ vim.api.nvim_set_keymap('n', '<leader>dn', '<cmd>lua vim.lsp.diagnostic.goto_nex
vim.api.nvim_set_keymap('n', '<leader>dN', '<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>', noremap)
vim.api.nvim_set_keymap('n', '<leader>dd', '<cmd>Telescope lsp_document_diagnostics<cr>', noremap)
vim.api.nvim_set_keymap('n', '<leader>dD', '<cmd>Telescope lsp_workspace_diagnostics<cr>', noremap)
vim.api.nvim_set_keymap('n', '<leader>xx', '<cmd>Telescope lsp_code_actions<cr>', noremap)
vim.api.nvim_set_keymap('n', '<leader>xd', '<cmd>%Telescope lsp_range_code_actions<cr>', noremap)
vim.api.nvim_set_keymap('n', '<leader>xx', '<cmd>lua vim.lsp.buf.code_action()<cr>', noremap)
-- dadbod stuff
vim.cmd([[

View file

@ -1,5 +1,17 @@
local util = require('lspconfig').util
-- replace built in selector with telescope
require('telescope').setup {
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown {
-- even more opts
}
}
}
}
require("telescope").load_extension("ui-select")
-- autocomplete config
local cmp = require 'cmp'
cmp.setup {

View file

@ -9,6 +9,7 @@ return require('packer').startup(function()
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} }
}
use 'nvim-telescope/telescope-ui-select.nvim' -- selector
use 'gpanders/editorconfig.nvim'
use 'neovim/nvim-lspconfig'
use 'hrsh7th/nvim-cmp' -- autocomplete