Skip to content

Instantly share code, notes, and snippets.

View kipawaa's full-sized avatar

River McCubbin kipawaa

View GitHub Profile
" Auto lists: Automatically continue/end lists by adding markers if the
" previous line is a list item, or removing them when they are empty
function! s:auto_list()
" get previous line
let l:prev_line = getline(line(".") - 1)
" get the leading whitespace from the previous line
let l:whitespace = matchstr(l:prev_line, '\v^\s*')
" if previous line is a non-empty ordered list item