diff --git a/lazy-lock.json b/lazy-lock.json index cf9f49a..b58f59f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -20,6 +20,7 @@ "nvim-lspconfig": { "branch": "master", "commit": "6c17f8656f667727b27f5f598463afedb7791b18" }, "nvim-treesitter": { "branch": "master", "commit": "6108ba7a135ed37e32276ccb877a348af17fe411" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, diff --git a/lua/nyanko/lazy/telescope.lua b/lua/nyanko/lazy/telescope.lua index f592842..9f4ae22 100644 --- a/lua/nyanko/lazy/telescope.lua +++ b/lua/nyanko/lazy/telescope.lua @@ -5,14 +5,28 @@ return { dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim", + "nvim-telescope/telescope-file-browser.nvim", }, config = function() require("telescope").setup({ + defaults = { + theme = "center", + sorting_strategy = "ascending", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.5, + }, + }, + }, extensions = { ["ui-select"] = { require("telescope.themes").get_dropdown(), }, }, + file_browser = { + hijack_netrw = true, + }, pickers = { find_files = { find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, @@ -21,11 +35,14 @@ return { }) pcall(require("telescope").load_extension, "ui-select") + require("telescope").load_extension("file_browser") local builtin = require("telescope.builtin") vim.keymap.set("n", "sf", builtin.find_files, { desc = "[S]earch [F]iles" }) vim.keymap.set("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[S]earch by current [W]ord" }) vim.keymap.set("n", "sr", builtin.oldfiles, { desc = "[S]earch [R]ecent files" }) + + vim.keymap.set("n", "ob", ":Telescope file_browser", { desc = "[O]pen File [B]rowser" }) end, }