dotfiles/nvim/lua/telescope-config.lua

22 lines
755 B
Lua
Raw Normal View History

2022-07-03 14:30:11 +02:00
local M = {}
local telescope = require("telescope")
M.project_files = function()
local opts = {show_untracked = false} -- define here if you want to define something
local ok = pcall(require"telescope.builtin".git_files, opts)
if not ok then require"telescope.builtin".find_files(opts) end
end
M.project_live_files = function()
local opts = {search_dirs = { "file_b", "file_a" }} -- define here if you want to define something
local ok = pcall(require"telescope.builtin".git_files, opts)
if not ok then require"telescope.builtin".find_files(opts) end
end
telescope.load_extension('fzf')
vim.api.nvim_set_keymap("n", "<C-p>", "<CMD>lua require'telescope-config'.project_files()<CR>", {noremap = true, silent = true})
return M