-- toggles group mappings -- local wk = require 'which-key' local gitsigns = require 'gitsigns' local function toggle_light_dark_theme() if vim.o.background == 'light' then vim.o.background = 'dark' else vim.o.background = 'light' end end local function toggle_conceal() local lvl = vim.o.conceallevel if lvl > DefaultConcealLevel then vim.o.conceallevel = DefaultConcealLevel else vim.o.conceallevel = FullConcealLevel end end wk.add { mode = { 'n' }, -- gitsigns { 'tb', gitsigns.toggle_current_line_blame, desc = 'toggle git show [b]lame line' }, { 'td', gitsigns.preview_hunk_inline, desc = 'toggle git show [d]eleted' }, { 'tm', 'RenderMarkdown buf_toggle', desc = 'toggle [m]arkdown rendering for current' }, { 'tt', toggle_light_dark_theme, desc = 'toggle light/dark [t]heme' }, { 'tc', toggle_conceal, desc = 'toggle [c]onceal' }, { 'tz', ':setlocal spell!', desc = 'toggle [z]pellcheck' }, } -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et