Skip to content

Commit 455fc88

Browse files
authored
Merge pull request #113 from hupfdule/configuratble_bullet_styles
Make bullet list item styles configurable
2 parents ab474fd + e53989a commit 455fc88

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

plugin/bullets.vim

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ while s:power >= 0
7272
let s:power -= 1
7373
endwhile
7474

75+
if !exists('g:bullets_list_item_styles')
76+
" A list of regex patterns that are recognized as bullet points for
77+
" bullet items.
78+
let g:bullets_list_item_styles = ['-', '\*+', '\.+', '#\.', '\+', '\\item']
79+
endif
80+
7581
if !exists('g:bullets_outline_levels')
7682
" Capitalization matters: all caps will make the symbol caps, lower = lower
7783
" Standard bullets should include the marker symbol after 'std'
@@ -324,7 +330,9 @@ fun! s:match_checkbox_bullet_item(input_text)
324330
endfun
325331

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

330338
if empty(l:matches)

0 commit comments

Comments
 (0)