diff --git a/lua/plugins.lua b/lua/plugins.lua index 55f5636..2995dd7 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -22,10 +22,11 @@ local lsp_on_attach = function(_, bufnr) -- Define standard LSP shortcuts nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - nmap('gd', vim.lsp.buf.definition, '[G]oto [d]efinition') - nmap('gr', vim.lsp.buf.references, '[G]oto [R]eferences') - nmap('gc', vim.lsp.buf.outgoing_calls, '[G]oto Outgoing [C]alls') - nmap('gt', vim.lsp.buf.type_definition, '[G]oto [T]ype definition') +-- these actions are now handled by Telescope +-- nmap('gd', vim.lsp.buf.definition, '[G]oto [d]efinition') +-- nmap('gr', vim.lsp.buf.references, '[G]oto [R]eferences') +-- nmap('gc', vim.lsp.buf.outgoing_calls, '[G]oto Outgoing [C]alls') +-- nmap('gt', vim.lsp.buf.type_definition, '[G]oto [T]ype definition') -- See `:help K` for why this keymap nmap('K', vim.lsp.buf.hover, 'Hover Documentation') @@ -46,7 +47,7 @@ local function manage_plugins() vim.g.rnvimr_action = { [''] = "NvimEdit tabedit", [''] = "NvimEdit split", - [''] = "NvimEdit vsplit", + [''] = "NvimEdit vsplit", } end }, @@ -211,6 +212,54 @@ local function manage_plugins() vim.api.nvim_set_keymap('n', 't', ":TagbarToggle", {}) end }, + ["https://github.com/nvim-telescope/telescope.nvim.git"] = { + packadd_after = { + ["https://github.com/nvim-lua/plenary.nvim.git"] = true, + }, + packadd_hook = function() + require("telescope").setup{ + defaults = { + -- Default configuration for telescope goes here: + -- config_key = value, + mappings = { + i = { + -- map actions.which_key to (default: ) + -- actions.which_key shows the mappings for your picker, + -- e.g. git_{create, delete, ...}_branch for the git_branches picker + [""] = "which_key" + } + } + }, + pickers = { + -- Default configuration for builtin pickers goes here: + -- picker_name = { + -- picker_config_key = value, + -- ... + -- } + -- Now the picker_config_key will be applied every time you call this + -- builtin picker + }, + extensions = { + -- Your extension configuration goes here: + -- extension_name = { + -- extension_config_key = value, + -- } + -- please take a look at the readme of the extension you want to configure + } + } + + vim.api.nvim_set_keymap('n', 'tf', ":Telescope find_files", {}) + vim.api.nvim_set_keymap('n', 'tg', ":Telescope live_grep", {}) + vim.api.nvim_set_keymap('n', 'ts', ":Telescope grep_string", {}) + vim.api.nvim_set_keymap('n', 'tt', ":Telescope tags", {}) + vim.api.nvim_set_keymap('n', 'tc', ":Telescope git_commits", {}) + vim.api.nvim_set_keymap('n', 'ta', ":Telescope git_status", {}) + vim.api.nvim_set_keymap('n', 'td', ":Telescope lsp_definitions", {}) + vim.api.nvim_set_keymap('n', 'tr', ":Telescope lsp_references", {}) + vim.api.nvim_set_keymap('n', 'tc', ":Telescope lsp_outgoing_calls", {}) + vim.api.nvim_set_keymap('n', 'te', ":Telescope diagnostics", {}) + end + }, -- Git integration ["https://github.com/tpope/vim-fugitive.git"] = {},