Use telescope to display references, diagnostics and code actions
This commit is contained in:
parent
b366437a6a
commit
f942ea2f91
@ -31,6 +31,7 @@
|
||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
|
||||
"vimwiki": { "branch": "dev", "commit": "705ad1e0dded0e3b7ff5fac78547ab67c9d39bdf" }
|
||||
|
@ -1,8 +1,3 @@
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', ',d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', '.d', vim.diagnostic.goto_next, opts)
|
||||
|
||||
local lsp_attach = function(client, buf)
|
||||
vim.api.nvim_buf_set_option(buf, "formatexpr", "v:lua.vim.lsp.formatexpr()")
|
||||
vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
@ -10,7 +5,17 @@ local lsp_attach = function(client, buf)
|
||||
|
||||
vim.lsp.inlay_hint.enable(true, nil)
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set('n', '<S-C-e>', require("telescope.builtin").diagnostics, opts)
|
||||
|
||||
|
||||
local bufopts = { noremap = true, silent = true, buffer = buf }
|
||||
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, bufopts)
|
||||
vim.keymap.set('n', '<C-e>', require("telescope.builtin").diagnostics, bufopts)
|
||||
vim.keymap.set('n', '<C-ü>d', vim.diagnostic.goto_prev, bufopts)
|
||||
vim.keymap.set('n', '<C-¨>d', vim.diagnostic.goto_next, bufopts)
|
||||
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
@ -19,7 +24,7 @@ local lsp_attach = function(client, buf)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
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', 'gr', require("telescope.builtin").lsp_references, bufopts)
|
||||
end
|
||||
|
||||
local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/packages/codelldb/extension/")
|
||||
|
@ -3,7 +3,27 @@ return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
version = '0.1.*',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set("n", "<leader>gh", require("telescope.builtin").git_bcommits, opts)
|
||||
vim.keymap.set("n", "<leader>gb", require("telescope.builtin").git_branches, opts)
|
||||
vim.keymap.set("n", "<leader>gs", require("telescope.builtin").git_status, opts)
|
||||
end
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
dependencies = { 'nvim-telescope/telescope.nvim' },
|
||||
config = function()
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown()
|
||||
}
|
||||
}
|
||||
}
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
}
|
||||
-- Don't really need it. Nicer than the default but that's it
|
||||
-- {
|
||||
-- 'nvim-tree/nvim-tree.lua',
|
||||
|
Loading…
Reference in New Issue
Block a user