diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index d779707..b981acb 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -10,7 +10,7 @@ vim.api.nvim_create_autocmd("PackChanged", { }) vim.pack.add({ - { src = "https://github.com/nvim-telescope/telescope.nvim", version = "v0.2.1" }, + { src = "https://github.com/nvim-telescope/telescope.nvim", version = "v0.2.1" }, "https://github.com/nvim-lua/plenary.nvim", "https://github.com/nvim-telescope/telescope-fzf-native.nvim", "https://gitlab.com/davvid/telescope-git-grep.nvim", @@ -19,21 +19,28 @@ vim.pack.add({ local ok, builtin = pcall(require, "telescope.builtin") if ok then + local defaults = require("telescope.themes").get_dropdown() + defaults["path_display"] = { + filename_first = { + reverse_directories = true, + }, + } require("telescope").setup({ - defaults = require("telescope.themes").get_ivy(), + defaults = defaults, }) local set = vim.keymap.set require("telescope").load_extension("fzf") require("telescope").load_extension("git_grep") require("telescope").load_extension("frecency") - set("n", "", function() + set("n", ";", function() require("telescope-frecency").start() end, { desc = "Telescope frecency" }) - set("n", ";", function() + set("n", "", function() require("telescope-frecency").start({ workspace = "CWD" }) end, { desc = "Telescope frecency" }) - set("n", "b", builtin.buffers, { desc = "Telescope buffers" }) + set("n", "b", function() builtin.buffers({ sort_mru = true, sort_lastused = true }) end, + { desc = "Telescope buffers" }) set("n", "cc", builtin.commands, { desc = "Telescope commands" }) set("n", "ch", builtin.command_history, { desc = "Telescope command history" }) set("n", "cH", builtin.highlights, { desc = "Telescope highlights" }) @@ -56,10 +63,6 @@ if ok then set("n", "gS", builtin.git_stash, { desc = "Telescope git stash" }) set("n", "ha", builtin.help_tags, { desc = "Telescope help tags" }) set("n", "hk", builtin.keymaps, { desc = "Telescope keymaps" }) - set("n", "l", builtin.current_buffer_fuzzy_find, { desc = "Telescope current buffer fuzzy find" }) - set("n", "L", function() - builtin.live_grep({ grep_open_files = true }) - end, { desc = "Telescope grep open files" }) set("n", "m", builtin.marks, { desc = "Telescope marks" }) set("n", "M", builtin.man_pages, { desc = "Telescope man pages" }) set("n", "o", builtin.oldfiles, { desc = "Telescope oldfiles" }) @@ -74,9 +77,13 @@ if ok then end, { desc = "Telescope git live grep" }) set("n", "S", builtin.live_grep, { desc = "Telescope live grep" }) set("n", "sh", builtin.search_history, { desc = "Telescope search history" }) + set("n", "sl", builtin.current_buffer_fuzzy_find, { desc = "Telescope current buffer fuzzy find" }) set("n", "so", function() builtin.grep_string({ grep_open_files = true }) end, { desc = "Telescope grep open files" }) + set("n", "su", function() + builtin.live_grep({ grep_open_files = true }) + end, { desc = "Telescope live grep open files" }) set({ "n", "v" }, "sw", function() require("git_grep").grep() end, { desc = "Telescope git grep word" }) @@ -92,7 +99,7 @@ if ok then set("n", "gd", builtin.lsp_definitions, { desc = "Goto Definition" }) set("n", "grr", builtin.lsp_references, { desc = "References" }) - set("n", "gI", builtin.lsp_implementations, { desc = "Goto Implementation" }) + set("n", "grI", builtin.lsp_implementations, { desc = "Goto Implementation" }) set("n", "gy", builtin.lsp_type_definitions, { desc = "Goto T[y]pe Definition" }) else print("plugin builtin missing")