diff --git a/README.md b/README.md index 6941f48..3b1c759 100644 --- a/README.md +++ b/README.md @@ -107,9 +107,41 @@ 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_name(lang) .. @@ -186,4 +204,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