From bb2e30b412c23b76ae876e792398f4926467d962 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 8 Jan 2025 15:45:00 -0800 Subject: added current config --- nvim/lua/plugins/telescope.lua | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 nvim/lua/plugins/telescope.lua (limited to 'nvim/lua/plugins/telescope.lua') diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..bd26f0f --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,52 @@ +return { + { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + + config = function() + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) + vim.keymap.set('n', '', builtin.git_files, { desc = 'hello world' }) + vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }); + end) + + vim.keymap.set("n", "rw", function() + builtin.grep_string { search = vim.fn.expand "", } + end, { silent = true}) + end + }, + + { + "debugloop/telescope-undo.nvim", + dependencies = { -- note how they're inverted to above example + { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + }, + keys = { + { -- lazy style key map + "u", + "Telescope undo", + desc = "undo history", + }, + }, + opts = { + -- don't use `defaults = { }` here, do this in the main telescope spec + extensions = { + undo = { + -- telescope-undo.nvim config, see below + }, + -- no other extensions here, they can have their own spec too + }, + }, + config = function(_, opts) + -- Calling telescope's setup from multiple specs does not hurt, it will happily merge the + -- configs for us. We won't use data, as everything is in it's own namespace (telescope + -- defaults, as well as each extension). + require("telescope").setup(opts) + require("telescope").load_extension("undo") + end, + }, +} -- cgit v1.2.3