[nvim] feat: add telescope-file-browser extension

properly setup Telescope in telescope.lua
provide a new keybinding
This commit is contained in:
David JULIEN 2022-12-26 19:04:56 +01:00
parent 3c7f8a29a7
commit a9cb5afdca
3 changed files with 29 additions and 0 deletions

View File

@ -20,6 +20,8 @@ vim.keymap.set("n", "<leader>u", function() require("packer").sync() end)
-- telescope -- telescope
vim.keymap.set("n", "<leader>tf", vim.keymap.set("n", "<leader>tf",
function() require("telescope.builtin").find_files() end) function() require("telescope.builtin").find_files() end)
vim.keymap.set("n", "<leader>tef",
function() require("telescope").extensions.file_browser.file_browser() end)
vim.keymap.set("n", "<leader>tb", vim.keymap.set("n", "<leader>tb",
function() require("telescope.builtin").buffers() end) function() require("telescope.builtin").buffers() end)
vim.keymap.set("n", "<leader>tg", vim.keymap.set("n", "<leader>tg",

View File

@ -65,9 +65,14 @@ return require("packer").startup(function()
"nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope-fzf-native.nvim",
run = "make" run = "make"
}, },
{
"nvim-telescope/telescope-file-browser.nvim",
}
}, },
config = function() config = function()
require("telescope")
require("telescope").load_extension("fzf") require("telescope").load_extension("fzf")
require("telescope").load_extension("file_browser")
end end
} }

View File

@ -0,0 +1,22 @@
-- Author : swytch
-- Created : Monday Dec. 26, 2022 18:39:16 CET
-- License : GPLv3
-- Description : treesitter config file
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
},
["n"] = {
-- your custom normal mode mappings
},
},
},
},
}