" lib.vim - Miscelaneous functions " " Author: Silvio Rhatto " " Checkbox handling " " This is commented out because vitalk/vim-simple-todo is being used instead. " " 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