local data = assert(vim.fn.stdpath "data") --[[@as string]] require("telescope").setup { defaults = { file_ignore_patterns = { "dune.lock" }, }, extensions = { wrap_results = true, fzf = {}, history = { path = vim.fs.joinpath(data, "telescope_history.sqlite3"), limit = 100, }, ["ui-select"] = { require("telescope.themes").get_dropdown {}, }, }, } pcall(require("telescope").load_extension, "fzf") pcall(require("telescope").load_extension, "smart_history") pcall(require("telescope").load_extension, "ui-select") local builtin = require "telescope.builtin" vim.keymap.set("n", "fd", builtin.find_files) vim.keymap.set("n", "ft", function() return builtin.git_files { cwd = vim.fn.expand "%:h" } end) vim.keymap.set("n", "fh", builtin.help_tags) vim.keymap.set("n", "fg", require "custom.telescope.multi-ripgrep") vim.keymap.set("n", "fb", builtin.buffers) vim.keymap.set("n", "/", builtin.current_buffer_fuzzy_find) vim.keymap.set("n", "gw", builtin.grep_string) vim.keymap.set("n", "fa", function() ---@diagnostic disable-next-line: param-type-mismatch builtin.find_files { cwd = vim.fs.joinpath(vim.fn.stdpath "data", "lazy") } end) vim.keymap.set("n", "en", function() builtin.find_files { cwd = vim.fn.stdpath "config" } end) vim.keymap.set("n", "eo", function() builtin.find_files { cwd = "~/.config/nvim-backup/" } end) vim.keymap.set("n", "fp", function() builtin.find_files { cwd = "~/plugins/" } end)