From a3103720f129bac2a60943d4e5e882144e5bd604 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 28 Jul 2024 15:21:01 -0300 Subject: Feat: try preservim/vim-markdown --- vim.dot.link/plugin/lib.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 vim.dot.link/plugin/lib.vim (limited to 'vim.dot.link/plugin') 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 +" + +" 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 c :call ToggleCheckbox() -- cgit v1.2.3