nvim: use smart-open as file finder
This commit is contained in:
parent
57a007be9d
commit
f1e44b26ee
1 changed files with 51 additions and 31 deletions
|
@ -3,43 +3,63 @@ return {
|
|||
"folke/flash.nvim",
|
||||
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",
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
opts = function(_, opts)
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
anchor = "top",
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
mirror = false,
|
||||
preview_width = 0.4,
|
||||
-- preview_height = 0.5,
|
||||
},
|
||||
width = 0.9,
|
||||
height = 0.9,
|
||||
preview_cutoff = 10,
|
||||
opts.defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
anchor = "top",
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
mirror = false,
|
||||
preview_width = 0.4,
|
||||
-- preview_height = 0.5,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close, -- <Esc> close popup
|
||||
["<C-u>"] = false, -- <C-u> clear prompt
|
||||
},
|
||||
},
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
wrap_results = true,
|
||||
previewer = false,
|
||||
preview = {
|
||||
hide_on_startup = true,
|
||||
width = 0.9,
|
||||
height = 0.9,
|
||||
preview_cutoff = 10,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close, -- <Esc> close popup
|
||||
["<C-u>"] = false, -- <C-u> clear prompt
|
||||
},
|
||||
},
|
||||
})
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
wrap_results = true,
|
||||
previewer = false,
|
||||
preview = {
|
||||
hide_on_startup = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue