dotfiles/nvim/lua/my/telescope.lua
Nikos Papadakis 2f6925561b
nvim
2024-02-23 11:39:16 +02:00

49 lines
1 KiB
Lua

local telescope = require "telescope"
local builtin = require "telescope.builtin"
telescope.setup {
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
}
}
}
local function project()
local exclusions = {
"**/.git/",
"*.svg",
"*.png",
"*.jpg",
}
local find_command = { "fd", "--hidden", "-t", "f" }
for _, value in ipairs(exclusions) do
table.insert(find_command, "--exclude")
table.insert(find_command, value)
end
builtin.find_files {
find_command = find_command,
}
end
local function dotfiles()
builtin.git_files {
shorten_path = true,
prompt_title = " ~ dotfiles ~ ",
cwd = vim.env.DOTFILES_DIRECTORY,
}
end
telescope.load_extension("fzf")
telescope.load_extension("ui-select")
require("my.keymaps").telescope_keymaps {
project = project,
dotfiles = dotfiles,
builtin = builtin,
}