Skip to content

Commit

Permalink
fix: clean up diff
Browse files Browse the repository at this point in the history
  • Loading branch information
fdschmidt93 committed Jan 17, 2022
1 parent a5c31e3 commit f42c3de
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,21 @@ Plug 'nvim-telescope/telescope-file-browser.nvim'

You can configure the `telescope-file-browser` like any other `telescope.nvim` picker. Please see `:h telescope-file-browser.picker` for the full set of options dedicated to the picker. For instance, you of course can map `theme` and [mappings](#remappings) as you are used to from `telescope.nvim`.

The setup below shows the defaults. You do not need to set any of the `file_browser` configuration. `require("telescope").load_extension "file_browser"` suffices for the default setup.

```lua
-- You don't need to set any of these options.
-- IMPORTANT!: this is only a showcase of how you can set default options!
require("telescope").setup {
extensions = {
file_browser = {
theme = "ivy",
mappings = {} -- See mappings section
files = true, -- Start in file_browser mode
hidden = false,
respect_gitignore = false, -- expensive with plenary, true if `fd` found
---@field files boolean: start in file (true) or folder (false) browser (default: true)
---@field add_dirs boolean: whether the file browser shows folders (default: true)
---@field depth number: file tree depth to display, `false` for unlimited depth (default: 1)
---@field dir_icon string: change the icon for a directory (default: )
---@field hidden boolean: determines whether to show hidden files or not (default: false)
---@field respect_gitignore boolean: induces slow-down w/ plenary finder (default: false, true if `fd` available)
---@field browse_files function: custom override for the file browser (default: |fb_finders.browse_files|)
---@field browse_folders function: custom override for the folder browser (default: |fb_finders.browse_folders|)
theme = "ivy",
mappings = {
["i"] = {
-- your custom insert mode mappings
},
["n"] = {
-- your custom normal mode mappings
},
},
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion lua/telescope/_extensions/file_browser/finders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fb_finders.browse_folders = function(opts)
-- returns copy with properly set cwd for entry maker
local cwd = opts.cwd_to_path and opts.path or opts.cwd
local entry_maker = opts.entry_maker { cwd = cwd }
if has_fd == 0 then
if has_fd then
local args = { "-a" }
if opts.hidden then
table.insert(args, "-H")
Expand Down
2 changes: 1 addition & 1 deletion lua/telescope/_extensions/file_browser/picker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ local fb_picker = {}
---@field dir_icon string: change the icon for a directory (default: )
---@field hidden boolean: determines whether to show hidden files or not (default: false)
---@field respect_gitignore boolean: induces slow-down w/ plenary finder (default: false, true if `fd` available)
---@filed types table: table incl. {"file", "directory"}, (default: { "directory" })
---@field types table: table incl. {"file", "directory"}, (default: { "directory" })
---@field browse_files function: custom override for the file browser (default: |fb_finders.browse_files|)
---@field browse_folders function: custom override for the folder browser (default: |fb_finders.browse_folders|)
fb_picker.file_browser = function(opts)
Expand Down

0 comments on commit f42c3de

Please sign in to comment.