Small refactors to telescope, remove the seperate file for fzf and

integrate it all into the dependency list of telescope, and some minor
refactoring.
This commit is contained in:
Martin Larsson 2024-07-07 18:03:19 +02:00
parent 9c62cab5c8
commit 26355c8a5c
2 changed files with 8 additions and 9 deletions

View file

@ -2,14 +2,18 @@ return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-telescope/telescope-fzf-native.nvim", {
"nvim-telescope/telescope-fzf-native.nvim",
build =
"cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
}
}, },
config = function() config = function()
require("telescope").setup({ require("telescope").setup({
extensions = { extensions = {
fzf = { fzf = {
fuzzy = true, fuzzy = true,
override_generic_sorter = false, override_generic_sorter = true,
override_file_sorter = true, override_file_sorter = true,
case_mode = "smart_case", case_mode = "smart_case",
}, },
@ -17,8 +21,6 @@ return {
}) })
require("telescope").load_extension("fzf") require("telescope").load_extension("fzf")
local builtin = require("telescope.builtin")
local dropdown = require("telescope.themes").get_dropdown({ local dropdown = require("telescope.themes").get_dropdown({
borderchars = { borderchars = {
prompt = { "", "", "", "", "", "", "", "" }, prompt = { "", "", "", "", "", "", "", "" },
@ -29,6 +31,7 @@ return {
winblend = 20 winblend = 20
}) })
local builtin = require("telescope.builtin")
local pickers = { local pickers = {
{ {
fn = builtin.find_files, fn = builtin.find_files,
@ -49,7 +52,7 @@ return {
fn = builtin.live_grep, fn = builtin.live_grep,
key = "a", key = "a",
picker_opts = { picker_opts = {
prompt_prefix = "Grep> " prompt_prefix = "Grep> ",
}, },
}, },
{ {

View file

@ -1,4 +0,0 @@
return {
"nvim-telescope/telescope-fzf-native.nvim",
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
}