From c05824e72878dd6b48ba4a24507534351d522b8a Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Sun, 11 Jul 2021 13:18:05 -0700 Subject: [PATCH] feature: add togglability and documentation --- README.md | 31 +++++++++++++++++++++++++++++++ lua/nvim-biscuits/init.lua | 24 ++++++++++++++++++++++++ 2 files changed, 55 insertions(+) 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