mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
updated
This commit is contained in:
parent
92cf882f42
commit
25686c4c64
1 changed files with 19 additions and 12 deletions
|
|
@ -20,10 +20,12 @@ return {
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check that the required prerequisites are installed.
|
||||||
if vim.fn.executable("chafa") == 0 then
|
if vim.fn.executable("chafa") == 0 then
|
||||||
return disableWithWarnMessage("The required prerequisite not installed: `Chafa`")
|
return disableWithWarnMessage("The required prerequisite not installed: `Chafa`")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check that at least one prerequisite is installed.
|
||||||
local hasFindCmd = vim.tbl_contains({ "find", "fd", "rg" }, function(cmd)
|
local hasFindCmd = vim.tbl_contains({ "find", "fd", "rg" }, function(cmd)
|
||||||
return vim.fn.executable(cmd) == 1
|
return vim.fn.executable(cmd) == 1
|
||||||
end, { predicate = true })
|
end, { predicate = true })
|
||||||
|
|
@ -80,18 +82,23 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Setup extension for media files when telescope is loaded
|
-- We checked that all required prerequisites were installed in the enabled function, but still ensure this again before setup.
|
||||||
LazyVim.on_load("telescope.nvim", function()
|
-- Set up the extension for media files when the telescope is loaded.
|
||||||
local ok, telescope = pcall(require, "telescope")
|
local medifaExtension = {
|
||||||
if ok then
|
filetypes = supportedFiletypeSet:toList(),
|
||||||
telescope.extensions["media_files"] = vim.tbl_extend("force", telescope.extensions["media_files"] or {}, {
|
find_cmd = findCmd,
|
||||||
filetypes = supportedFiletypeSet:toList(),
|
}
|
||||||
find_cmd = findCmd,
|
if medifaExtension.find_cmd and #medifaExtension.filetypes > 0 then
|
||||||
})
|
LazyVim.on_load("telescope.nvim", function()
|
||||||
else
|
local ok, telescope = pcall(require, "telescope")
|
||||||
LazyVim.error("Failed to load telescope.nvim")
|
if ok then
|
||||||
end
|
telescope.extensions["media_files"] =
|
||||||
end)
|
vim.tbl_extend("force", telescope.extensions["media_files"] or {}, medifaExtension)
|
||||||
|
else
|
||||||
|
LazyVim.error("Failed to load telescope.nvim")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>fP", "<cmd>Telescope media_files<cr>", desc = "Find Media Files" },
|
{ "<leader>fP", "<cmd>Telescope media_files<cr>", desc = "Find Media Files" },
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue