diff --git a/lazy-lock.json b/lazy-lock.json index fd48387..71431fe 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -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" } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 40ecbb7..2eb3c1b 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,8 +1,3 @@ -local opts = { noremap = true, silent = true } -vim.keymap.set('n', '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', '', require("telescope.builtin").diagnostics, opts) + + local bufopts = { noremap = true, silent = true, buffer = buf } + + vim.keymap.set('n', 'e', vim.diagnostic.open_float, bufopts) + vim.keymap.set('n', '', require("telescope.builtin").diagnostics, bufopts) + vim.keymap.set('n', 'd', vim.diagnostic.goto_prev, bufopts) + vim.keymap.set('n', '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', 'D', vim.lsp.buf.type_definition, bufopts) vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', '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/") diff --git a/lua/plugins/navigation.lua b/lua/plugins/navigation.lua index bfa7cfd..dd52c4a 100644 --- a/lua/plugins/navigation.lua +++ b/lua/plugins/navigation.lua @@ -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", "gh", require("telescope.builtin").git_bcommits, opts) + vim.keymap.set("n", "gb", require("telescope.builtin").git_branches, opts) + vim.keymap.set("n", "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',