Skip to content

Commit 8df20be

Browse files
authored
Merge pull request #34 from wsdjeg/master
Add option for formatting item list
2 parents 7553b05 + bc56bb0 commit 8df20be

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
@@ -210,7 +218,7 @@ endfunction
210218
function! s:GenToc(markdownStyle)
211219
let l:headingLines = <SID>GetHeadingLines()
212220
let l:levels = []
213-
let l:listItemChars = ['*']
221+
let l:listItemChars = [g:vmt_list_item_char]
214222

215223
let g:GFMHeadingIds = {}
216224

@@ -225,7 +233,7 @@ function! s:GenToc(markdownStyle)
225233
endif
226234

227235
if g:vmt_cycle_list_item_markers == 1
228-
let l:listItemChars += ['-', '+']
236+
let l:listItemChars = ['*', '-', '+']
229237
endif
230238

231239
let l:i = 0
@@ -258,6 +266,9 @@ function! s:GenToc(markdownStyle)
258266
endfunction
259267

260268
function! s:GetIndentText()
269+
if !empty(g:vmt_list_indent_text)
270+
return g:vmt_list_indent_text
271+
endif
261272
if &expandtab
262273
return repeat(" ", &shiftwidth)
263274
else

0 commit comments

Comments
 (0)