Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bullet list item styles configurable #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ while s:power >= 0
let s:power -= 1
endwhile

if !exists('g:bullets_list_item_styles')
" A list of regex patterns that are recognized as bullet points for
" bullet items.
let g:bullets_list_item_styles = ['-', '\*+', '\.+', '#\.', '\+', '\\item']
endif

if !exists('g:bullets_outline_levels')
" Capitalization matters: all caps will make the symbol caps, lower = lower
" Standard bullets should include the marker symbol after 'std'
Expand Down Expand Up @@ -267,7 +273,9 @@ fun! s:match_checkbox_bullet_item(input_text)
endfun

fun! s:match_bullet_list_item(input_text)
let l:std_bullet_regex = '\v(^(\s*)(-|\*+|\.+|#\.|\+|\\item)(\s+))(.*)'
let l:std_bullet_regex = '\v(^(\s*)('
\ . join(g:bullets_list_item_styles, '|')
\ . ')(\s+))(.*)'
let l:matches = matchlist(a:input_text, l:std_bullet_regex)

if empty(l:matches)
Expand Down