mirror of
https://github.com/opdavies/toggle-checkbox.nvim.git
synced 2025-11-12 04:38:45 +00:00
feat: check and uncheck checkboxes
This commit is contained in:
commit
6151b3c0e2
2 changed files with 14 additions and 0 deletions
1
init.lua
Normal file
1
init.lua
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
require("toggle-checkbox")
|
||||||
13
lua/toggle-checkbox.lua
Normal file
13
lua/toggle-checkbox.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
local checked_character = "x"
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.check = function(line)
|
||||||
|
return line:gsub("%[ %]", "[" .. checked_character .. "]")
|
||||||
|
end
|
||||||
|
|
||||||
|
M.uncheck = function(line)
|
||||||
|
return line:gsub("%[" .. checked_character .. "%]", "[]")
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
Loading…
Add table
Add a link
Reference in a new issue