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>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_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>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>xx', '<cmd>lua vim.lsp.buf.code_action()<cr>', noremap)
vim.api.nvim_set_keymap('n', '<leader>xd', '<cmd>%Telescope lsp_range_code_actions<cr>', noremap)
-- dadbod stuff -- dadbod stuff
vim.cmd([[ vim.cmd([[

View File

@ -1,5 +1,17 @@
local util = require('lspconfig').util 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 -- autocomplete config
local cmp = require 'cmp' local cmp = require 'cmp'
cmp.setup { cmp.setup {

View File

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