🐛 fix(nvim): install fzf for telescope by default if make is available
This commit is contained in:
parent
70be1da977
commit
1f38692ec8
1 changed files with 23 additions and 5 deletions
|
@ -7,11 +7,16 @@ return {
|
||||||
cmd = "Telescope",
|
cmd = "Telescope",
|
||||||
version = false, -- telescope did only one release, so use HEAD for now
|
version = false, -- telescope did only one release, so use HEAD for now
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
{
|
||||||
build = "make",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
config = function()
|
build = "make",
|
||||||
require("telescope").load_extension("fzf")
|
enabled = vim.fn.executable("make") == 1,
|
||||||
end,
|
config = function()
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("fzf")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
@ -407,6 +412,19 @@ return {
|
||||||
defaults = {
|
defaults = {
|
||||||
prompt_prefix = " ",
|
prompt_prefix = " ",
|
||||||
selection_caret = " ",
|
selection_caret = " ",
|
||||||
|
-- open files in the first window that is an actual file.
|
||||||
|
-- use the current window if no other window is available.
|
||||||
|
get_selection_window = function()
|
||||||
|
local wins = vim.api.nvim_list_wins()
|
||||||
|
table.insert(wins, 1, vim.api.nvim_get_current_win())
|
||||||
|
for _, win in ipairs(wins) do
|
||||||
|
local buf = vim.api.nvim_win_get_buf(win)
|
||||||
|
if vim.bo[buf].buftype == "" then
|
||||||
|
return win
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end,
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
["<c-t>"] = open_with_trouble,
|
["<c-t>"] = open_with_trouble,
|
||||||
|
|
Loading…
Add table
Reference in a new issue