diff --git a/README.md b/README.md index e593462d..9b572c4f 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,8 @@ local fb_actions = require "telescope._extensions.file_browser.actions" require("telescope").setup { extensions = { file_browser = { - -- path - -- cwd + path = vim.loop.cwd() + cwd = vim.loop.cwd() cwd_to_path = false, grouped = false, files = true, @@ -105,10 +105,10 @@ require("telescope").setup { auto_depth = false, select_buffer = false, hidden = { file_browser = false, folder_browser = false }, - -- respect_gitignore - -- browse_files - -- browse_folders + respect_gitignore = vim.fn.executable "fd" == 1 follow_symlinks = false, + browse_files = require("telescope._extensions.file_browser.finders").browse_files, + browse_folders = require("telescope._extensions.file_browser.finders").browse_folders, hide_parent_dir = false, collapse_dirs = false, prompt_path = false, diff --git a/doc/telescope-file-browser.txt b/doc/telescope-file-browser.txt index f83e3fe1..73b795e3 100644 --- a/doc/telescope-file-browser.txt +++ b/doc/telescope-file-browser.txt @@ -63,8 +63,10 @@ fb_picker.file_browser({opts}) *telescope-file-browser.picker.file_browser()* List, create, delete, rename, or move files and folders of your cwd. Notes - Default keymaps in insert/normal mode: - - ``: opens the currently selected file, or navigates to the + - `` : Opens the currently selected file, or navigates to the currently selected directory + - `/`, `\` : (OS Path separator) When typing filepath, the path separator + will open a directory like ``. - `/c`: Create file/folder at current `path` (trailing path separator creates folder) - `/r`: Rename multi-selected files/folders @@ -132,8 +134,8 @@ fb_picker.file_browser({opts}) *telescope-file-browser.picker.file_browser()* finder (default: false, true if `fd` available) {follow_symlinks} (boolean) traverse symbolic links, i.e. - files and folders (default: false, - only works with `fd` ) + files and folders (default: + false, only works with `fd`) {browse_files} (function) custom override for the file browser (default: |fb_finders.browse_files|) @@ -467,8 +469,8 @@ fb_finders.finder({opts}) *telescope-file-browser.finders.finder()* finder (default: false, true if `fd` available) {follow_symlinks} (boolean) traverse symbolic links, i.e. - files and folders (default: false, - only works with `fd`) + files and folders (default: + false, only works with `fd`) {hide_parent_dir} (boolean) hide `../` in the file browser (default: false) {dir_icon} (string) change the icon for a directory diff --git a/lua/telescope/_extensions/file_browser/config.lua b/lua/telescope/_extensions/file_browser/config.lua index ef002f20..d93d3343 100644 --- a/lua/telescope/_extensions/file_browser/config.lua +++ b/lua/telescope/_extensions/file_browser/config.lua @@ -1,6 +1,4 @@ local fb_actions = require "telescope._extensions.file_browser.actions" -local fb_utils = require "telescope._extensions.file_browser.utils" -local scan = require "plenary.scandir" local Path = require "plenary.path" local action_state = require "telescope.actions.state"