diff --git a/OPTIONS.md b/OPTIONS.md index 3a881f9f..f74fabe5 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -196,9 +196,17 @@ require("fzf-lua").setup({ files = { formatter = "path.filename_first" } }) #### globals.file_icons -Type: `boolean`, Default: `true` +Type: `boolean|string`, Default: `true` + +If available, display file icons. + +Set to `true` will attempt to use "nvim-web-devicons" and fallback to "mini.icons", other possible +values are `devicons` or `mini` which force loading a specific icons plugin, for example: -If available, add devicons to files. +```lua +:FzfLua files file_icons=mini +:lua require("fzf-lua").files({ file_icons = "devicons" }) +``` #### globals.git_icons diff --git a/README.md b/README.md index 477e01b3..ea3f4067 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ at it. That, **and colorful file icons and git indicators!**. - [`fzf`](https://github.com/junegunn/fzf) version > `0.25` **or** [`skim`](https://github.com/lotabout/skim) binary installed - [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) + **or** [mini.icons](https://github.com/echasnovski/mini.icons) (optional) ### Optional dependencies @@ -157,6 +158,8 @@ Using [vim-plug](https://github.com/junegunn/vim-plug) Plug 'ibhagwan/fzf-lua', {'branch': 'main'} " optional for icon support Plug 'nvim-tree/nvim-web-devicons' +" or if using mini.icons/mini.nvim +" Plug 'echasnovski/mini.icons' ``` Using [packer.nvim](https://github.com/wbthomason/packer.nvim) @@ -165,6 +168,8 @@ Using [packer.nvim](https://github.com/wbthomason/packer.nvim) use { "ibhagwan/fzf-lua", -- optional for icon support requires = { "nvim-tree/nvim-web-devicons" } + -- or if using mini.icons/mini.nvim + -- requires = { "echasnovski/mini.icons" } } ``` @@ -807,9 +812,9 @@ require'fzf-lua'.setup { }, -- PROVIDERS SETUP -- use `defaults` (table or function) if you wish to set "global-provider" defaults - -- for example, disabling file icons globally and open the quickfix list at the top + -- for example, using "mini.icons" globally and open the quickfix list at the top -- defaults = { - -- file_icons = false, + -- file_icons = "mini", -- copen = "topleft copen", -- }, files = { diff --git a/doc/fzf-lua-opts.txt b/doc/fzf-lua-opts.txt index 7f424967..69c3d7f0 100644 --- a/doc/fzf-lua-opts.txt +++ b/doc/fzf-lua-opts.txt @@ -248,10 +248,18 @@ Or via `setup` for permanency: globals.file_icons *fzf-lua-opts-globals.file_icons* -Type: `boolean`, Default: `true` +Type: `boolean|string`, Default: `true` + +If available, display file icons. -If available, add devicons to files. +Set to `true` will attempt to use "nvim-web-devicons" and fallback to +"mini.icons", other possible values are `devicons` or `mini` which force +loading a specific icons plugin, for example: +>lua + :FzfLua files file_icons=mini + :lua require("fzf-lua").files({ file_icons = "devicons" }) +< globals.git_icons *fzf-lua-opts-globals.git_icons*