mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-07 07:54:38 +02:00
feat(keymaps): dynamic which-key icons/descriptions for toggles
This commit is contained in:
parent
6911327a5e
commit
82a3ccc4d6
5 changed files with 192 additions and 115 deletions
|
@ -97,10 +97,19 @@ end
|
|||
|
||||
---@param buf? boolean
|
||||
function M.toggle(buf)
|
||||
M.enable(not M.enabled(), buf)
|
||||
end
|
||||
|
||||
---@param enable? boolean
|
||||
---@param buf? boolean
|
||||
function M.enable(enable, buf)
|
||||
if enable == nil then
|
||||
enable = true
|
||||
end
|
||||
if buf then
|
||||
vim.b.autoformat = not M.enabled()
|
||||
vim.b.autoformat = enable
|
||||
else
|
||||
vim.g.autoformat = not M.enabled()
|
||||
vim.g.autoformat = enable
|
||||
vim.b.autoformat = nil
|
||||
end
|
||||
M.info()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue