local done_setup = false local function setup() local telescope = require 'telescope' local actions = require('telescope.actions') telescope.setup { defaults = { selection_strategy = "reset", winblend = 15, mappings = { i = { [""] = actions.select_tab, [""] = actions.select_default, [""] = actions.close, } } }, extensions = { ["ui-select"] = { require("telescope.themes").get_dropdown{} } } } telescope.load_extension('fzf') telescope.load_extension('ui-select') end local function nmap(key) return function(spec) local fun, opts if type(spec) == 'string' then fun = spec else fun = spec[1] spec[1] = nil opts = spec end vim.keymap.set('n', key, function() if not done_setup then setup() done_setup = true end require('telescope.builtin')[fun](opts) end, {}) end end -- default: CTRL-B scroll N screens Backwards nmap '' 'buffers' nmap '' {'git_files', use_git_root=true} nmap '' {'git_files', cwd="$HOME/projects/dotfiles", hidden=true} nmap 'f' 'find_files' nmap 'g' 'live_grep'