diff --git a/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/telescope.lua b/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/telescope.lua index b7b1231..5f4c935 100644 --- a/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/telescope.lua +++ b/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/telescope.lua @@ -1,4 +1,4 @@ -local function git_root() +local function get_root() local git_dir = vim.fn.systemlist("git rev-parse --show-toplevel")[1] if git_dir and git_dir ~= "" then return git_dir @@ -12,19 +12,15 @@ return { "nvim-telescope/telescope.nvim", brach = '0.1.x', dependencies = { - { - 'nvim-lua/plenary.nvim' - }, - { - 'nvim-tree/nvim-web-devicons' - } + { 'nvim-lua/plenary.nvim' }, + { 'nvim-tree/nvim-web-devicons' } }, config = function() -- Custom Telescope command to grep from Git root require("which-key").add({ { "/", function() - require('telescope.builtin').live_grep({ cwd = git_root() }) - end, + require('telescope.builtin').live_grep({ cwd = get_root() }) + end, desc = "grep" }, { "/", ":Telescope live_grep", desc = "grep" }, { "ff", ":Telescope fd", desc = "Search for Files" }, @@ -33,7 +29,18 @@ return { { "cm", ":Telescope man_pages", desc = "Manpages" }, -- Code - { "gd", ":Telescope lsp_definitions", desc = "Go to Definition" }, + { "gd", + function() + local attached = vim.lsp.buf_get_clients(0) + if next(attached) ~= nil then + require('telescope.builtin').lsp_definitions() + else + vim.api.nvim_command('normal! gd') + end + end, + mode = "n", + desc = "Go to Definition" + }, { "gd", ":Telescope lsp_definitions", desc = "Go to Definition" }, { "gr", ":Telescope lsp_references", desc = "Goto References" }, { "gi", ":Telescope lsp_implementations", desc = "Go to Implementations" }, diff --git a/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/which-key.lua b/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/which-key.lua index 130a6df..c3ce10d 100644 --- a/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/which-key.lua +++ b/src/user/modules/utils/modules/neovim/config/lazyvim/lua/plugins/which-key.lua @@ -5,7 +5,6 @@ return { opts = { spec = { { "l", ":Lazy", desc = "Lazy" }, - { "t", function() vim.cmd("botright new | setlocal nonumber norelativenumber | resize 10 | terminal")