Skip to content

Commit f7a62cc

Browse files
committed
Add option for formatting item list
1 parent f42c2fd commit f7a62cc

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.swp
22
.DS_Store
3+
tags

ftplugin/markdown.vim

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ if !exists("g:vmt_dont_insert_fence")
1414
let g:vmt_dont_insert_fence = 0
1515
endif
1616

17+
if !exists("g:vmt_list_item_char")
18+
let g:vmt_list_item_char = '-'
19+
endif
20+
21+
if !exists("g:vmt_list_indent_text")
22+
let g:vmt_list_indent_text = ' '
23+
endif
24+
1725
if !exists("g:vmt_cycle_list_item_markers")
1826
let g:vmt_cycle_list_item_markers = 0
1927
endif
@@ -180,7 +188,7 @@ endfunction
180188
function! s:GenToc(markdownStyle)
181189
let l:headingLines = <SID>GetHeadingLines()
182190
let l:levels = []
183-
let l:listItemChars = ['*']
191+
let l:listItemChars = [g:vmt_list_item_char]
184192

185193
let g:GFMHeadingIds = {}
186194

@@ -195,7 +203,7 @@ function! s:GenToc(markdownStyle)
195203
endif
196204

197205
if g:vmt_cycle_list_item_markers == 1
198-
let l:listItemChars += ['-', '+']
206+
let l:listItemChars = ['*', '-', '+']
199207
endif
200208

201209
let l:i = 0
@@ -228,6 +236,9 @@ function! s:GenToc(markdownStyle)
228236
endfunction
229237

230238
function! s:GetIndentText()
239+
if !empty(g:vmt_list_indent_text)
240+
return g:vmt_list_indent_text
241+
endif
231242
if &expandtab
232243
return repeat(" ", &shiftwidth)
233244
else

0 commit comments

Comments
 (0)