-- telescope.nvim – https://github.com/nvim-telescope/telescope.nvim/ local status_ok, telescope = pcall(require, "telescope") if not status_ok then return end local keymap = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } local actions = require("telescope.actions") -- Extensions telescope.load_extension("bookmarks") telescope.load_extension("node_modules") telescope.load_extension("file_browser") telescope.load_extension("frecency") telescope.load_extension("lsp_handlers") telescope.load_extension("fzf") telescope.load_extension("harpoon") telescope.load_extension("projects") telescope.load_extension("heading") telescope.load_extension("gh") -- Keymaps keymap("n", "", [[Telescope find_files]], opts) keymap("n", "C", [[Cheatsheet]], opts) keymap("n", "F", [[Telescope live_grep]], opts) keymap("n", "H", [[Telescope headings]], opts) keymap("n", "S", [[Telescope spell_suggest]], opts) keymap("n", "b", [[Telescope buffers]], opts) keymap("n", "bm", [[Telescope bookmarks]], opts) keymap("n", "f", [[Telescope current_buffer_fuzzy_find]], opts) keymap("n", "fa", [[Telescope find_files hidden=true]], opts) keymap("n", "fb", [[Telescope file_browser]], opts) keymap("n", "gb", [[Telescope git_branches]], opts) keymap("n", "gs", [[Telescope git_status]], opts) keymap("n", "ht", [[Telescope help_tags]], opts) keymap("n", "km", [[Telescope keymaps]], opts) keymap("n", "m", [[Telescope marks]], opts) keymap("n", "mru", [[Telescope frecency]], opts) keymap("n", "nm", [[Telescope node_modules list]], opts) keymap("n", "r", [[Telescope resume]], opts) keymap("n", "tg", [[Telescope tags]], opts) -- Setup telescope.setup({ defaults = { prompt_prefix = " ", selection_caret = " ", path_display = { "smart", }, file_ignore_pattern = { "yarn.lock", }, mappings = { -- INSERT Mode i = { [""] = actions.cycle_history_next, [""] = actions.cycle_history_prev, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, [""] = actions.close, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, [""] = actions.select_default, [""] = actions.select_horizontal, [""] = actions.select_vertical, [""] = actions.select_tab, [""] = actions.preview_scrolling_up, [""] = actions.preview_scrolling_down, [""] = actions.results_scrolling_up, [""] = actions.results_scrolling_down, [""] = actions.toggle_selection + actions.move_selection_worse, [""] = actions.toggle_selection + actions.move_selection_better, [""] = actions.send_to_qflist + actions.open_qflist, [""] = actions.send_selected_to_qflist + actions.open_qflist, [""] = actions.complete_tag, [""] = actions.which_key, -- keys from pressing }, -- NORMAL Mode n = { [""] = actions.close, [""] = actions.select_default, [""] = actions.select_horizontal, [""] = actions.select_vertical, [""] = actions.select_tab, [""] = actions.toggle_selection + actions.move_selection_worse, [""] = actions.toggle_selection + actions.move_selection_better, [""] = actions.send_to_qflist + actions.open_qflist, [""] = actions.send_selected_to_qflist + actions.open_qflist, ["j"] = actions.move_selection_next, ["k"] = actions.move_selection_previous, ["H"] = actions.move_to_top, ["M"] = actions.move_to_middle, ["L"] = actions.move_to_bottom, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, ["gg"] = actions.move_to_top, ["G"] = actions.move_to_bottom, [""] = actions.preview_scrolling_up, [""] = actions.preview_scrolling_down, [""] = actions.results_scrolling_up, [""] = actions.results_scrolling_down, ["?"] = actions.which_key, }, }, }, pickers = { buffers = { theme = "dropdown", previewer = false, show_all_buffers = true, sort_lastused = true, }, }, extensions = { fzf = { fuzzy = true, override_generic_sorter = true, override_file_sorter = true, case_mode = "smart_case", }, file_browser = { theme = "ivy", hijack_netrw = true, }, frecency = { show_scores = false, show_unindexed = true, ignore_patterns = { "*.git/*", "*/tmp/*", }, disable_devicons = false, }, bookmarks = { selected_browser = "brave", url_open_command = "open", }, lsp_handlers = { disable = {}, location = { telescope = {}, no_results_message = "No references found", }, symbol = { telescope = {}, no_results_message = "No symbols found", }, call_hierarchy = { telescope = {}, no_results_message = "No calls found", }, code_action = { telescope = require("telescope.themes").get_dropdown({}), no_results_message = "No code actions available", prefix = "", }, }, }, })