aboutsummaryrefslogtreecommitdiff
path: root/vim.dot.link/plugin
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-28 15:21:01 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-28 15:21:01 -0300
commita3103720f129bac2a60943d4e5e882144e5bd604 (patch)
tree04144ead383ac79717e20b167ee4425e11e8fbfc /vim.dot.link/plugin
parentfd271de3618194c264248e82c1441fd520e498fb (diff)
downloadvim-a3103720f129bac2a60943d4e5e882144e5bd604.tar.gz
vim-a3103720f129bac2a60943d4e5e882144e5bd604.tar.bz2
Feat: try preservim/vim-markdown
Diffstat (limited to 'vim.dot.link/plugin')
-rw-r--r--vim.dot.link/plugin/lib.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/vim.dot.link/plugin/lib.vim b/vim.dot.link/plugin/lib.vim
new file mode 100644
index 0000000..7e71c6f
--- /dev/null
+++ b/vim.dot.link/plugin/lib.vim
@@ -0,0 +1,21 @@
+" lib.vim - Miscelaneous functions
+"
+" Author: Silvio Rhatto <rhatto@riseup.net>
+"
+
+" Checkbox handling
+"
+" Thanks https://www.reddit.com/r/vim/comments/slqsao/readymade_solution_for_handling_markdown/
+"function! ToggleCheckbox()
+" let line = getline('.')
+"
+" if line =~ '- \[ \]'
+" call setline('.', substitute(line, '- \[ \]', '- \[x\]', ''))
+" elseif line =~ '- \[x\]'
+" call setline('.', substitute(line, '- \[x\]', '- \[ \]', ''))
+" elseif line =~ '- '
+" call setline('.', substitute(line, '- ', '- \[ \] ', ''))
+" endif
+"endf
+"
+"nnoremap <Leader>c :call ToggleCheckbox()<CR>