Skip to content

Commit

Permalink
feat(config): add option to disable icons
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Jun 10, 2023
1 parent 7367616 commit f08ab63
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ https://github.com/Bekaboo/dropbar.nvim/assets/76579810/e8c1ac26-0321-4762-9975-
},
},
icons = {
enable = true,
kinds = {
use_devicons = true,
symbols = {
Expand Down Expand Up @@ -593,6 +594,9 @@ general behavior of the plugin:
These options live under `opts.icons` and are used to configure the icons
used by the plugin:

- `opts.icons.enable`: `boolean`
- Whether to enable icons
- Default: `true`
- `opts.icons.kinds.use_devicons`: `boolean`
- Whether to use [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) to show icons for different filetypes
- Default: `true`
Expand Down
3 changes: 3 additions & 0 deletions doc/dropbar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ ICONS *dropbar-configuration-options-icons*
These options live under `opts.icons` and are used to configure the icons used
by the plugin:

- `opts.icons.enable`: `boolean`
- Whether to enable icons
- Default: `true`
- `opts.icons.kinds.use_devicons`: `boolean`
- Whether to use nvim-web-devicons
<https://github.com/nvim-tree/nvim-web-devicons> to show icons for
Expand Down
12 changes: 12 additions & 0 deletions lua/dropbar/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ M.opts = {
},
},
icons = {
enable = true,
kinds = {
use_devicons = true,
symbols = {
Expand Down Expand Up @@ -386,6 +387,17 @@ function M.set(new_opts)
win = new_opts.general.update_events,
}
end
if new_opts.icons and not new_opts.icons.enable then
local blank_icons = setmetatable({}, {
__index = function()
return ' '
end,
})
M.opts.icons.kinds.use_devicons = false
M.opts.icons.kinds.symbols = blank_icons
M.opts.icons.ui.bar = blank_icons
M.opts.icons.ui.menu = blank_icons
end
M.opts = vim.tbl_deep_extend('force', M.opts, new_opts)
end

Expand Down

0 comments on commit f08ab63

Please sign in to comment.