diff --git a/README.md b/README.md index 7de2fdf..575e119 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,37 @@ require('nvim-biscuits').setup({ EOF ``` +## Configuration (Keybinding to toggle visibility) + +You can show or hide the biscuits by placing a `toggle_keybind` at the root of your config or inside a language config. + +```lua +lua <", + {noremap = false}) + end + local on_lines = function() nvim_biscuits.decorate_nodes(bufnr, lang) end vim.cmd("highlight default link " .. make_biscuit_hl_group(lang) .. @@ -164,4 +181,11 @@ nvim_biscuits.BufferAttach = function(bufnr) end end +nvim_biscuits.toggle_biscuits = function() + should_render_biscuits = not should_render_biscuits + local bufnr = vim.api.nvim_get_current_buf() + local lang = ts_parsers.get_buf_lang(bufnr) + nvim_biscuits.decorate_nodes(bufnr, lang) +end + return nvim_biscuits