blob: 7e71c6f42f678bc39a74181f7107c4c0dc85325c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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>
|