nvim: use smart-open as file finder

This commit is contained in:
Daniel Lundin 2024-05-25 11:27:18 +02:00
parent 57a007be9d
commit f1e44b26ee
No known key found for this signature in database

View file

@ -3,15 +3,36 @@ return {
"folke/flash.nvim", "folke/flash.nvim",
enabled = false, enabled = false,
}, },
{ "aohoyd/broot.nvim", opts = {} },
{
"danielfalk/smart-open.nvim",
branch = "0.2.x",
dependencies = {
"kkharji/sqlite.lua",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "nvim-telescope/telescope-fzy-native.nvim" },
},
keys = {
{
"<leader><leader>",
":lua require('telescope').extensions.smart_open.smart_open {filename_first = false }<cr>",
desc = "Telescope smart open",
},
},
config = function()
local util = require("lazyvim.util")
util.on_load("telescope.nvim", function()
local telescope = require("telescope")
telescope.load_extension("smart_open")
end)
end,
},
{ {
"telescope.nvim", "telescope.nvim",
config = function() opts = function(_, opts)
local telescope = require("telescope")
local actions = require("telescope.actions") local actions = require("telescope.actions")
opts.defaults = {
telescope.setup({
defaults = {
layout_strategy = "horizontal", layout_strategy = "horizontal",
layout_config = { layout_config = {
anchor = "top", anchor = "top",
@ -38,8 +59,7 @@ return {
preview = { preview = {
hide_on_startup = true, hide_on_startup = true,
}, },
}, }
})
end, end,
}, },
} }