add telescope file browser

This commit is contained in:
ksyasuda
2022-11-04 18:31:16 -07:00
parent a091ec5959
commit 2efde35597
4 changed files with 36 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ db.custom_center = {
action ='SessionLoad'},
{icon = '',
desc = 'Recently opened files ',
action = 'DashboardFindHistory',
action = 'Telescope oldfiles',
shortcut = 'SPC f h'},
{icon = '',
desc = 'Find File ',
@@ -23,7 +23,7 @@ db.custom_center = {
shortcut = 'SPC f f'},
{icon = '',
desc ='File Browser ',
action = 'NvimTreeToggle',
action = 'Telescope file_browser',
shortcut = 'SPC f b'},
{icon = '',
desc = 'Find word ',

View File

@@ -0,0 +1,25 @@
local fb_actions = require "telescope".extensions.file_browser.actions
require("telescope").setup {
extensions = {
file_browser = {
-- theme = "ivy",
-- disables netrw and use telescope-file-browser in its place
hijack_netrw = true,
mappings = {
["i"] = {
-- your custom insert mode mappings
["<C-h>"] = fb_actions.goto_home_dir,
["<C-x>"] = function(prompt_bufnr)
end
},
["n"] = {
-- your custom normal mode mappings
f = false,
},
},
},
},
}
-- To get telescope-file-browser loaded and working with telescope,
-- you need to call load_extension, somewhere after setup function:
require("telescope").load_extension "file_browser"