Skip to content

Commit 9b929ae

Browse files
committed
Implements automatic conversion to new file format (#20)
1 parent d500f7f commit 9b929ae

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ Changelog
257257
#### 0.7.0
258258

259259
* Added automatic date insertion feature
260-
* Items list are made markdown compatible
261260
* Added mappings for fast increasing/decreasing indent
261+
* Items list are made markdown compatible (old files updated automatically on load)
262262

263263
Credits
264264
-------

doc/vim-todo-lists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*vim-todo-lists.txt* Version 0.6.0
1+
*vim-todo-lists.txt* Version 0.7.0
22
*vim-todo-lists*
33

44
Plugin for TODO lists management.
@@ -291,8 +291,9 @@ SOFTWARE.
291291
0.7.0
292292

293293
* Added automatic date insertion feature
294-
* Items list are made markdown compatible
295294
* Added mappings for fast increasing/decreasing indent
295+
* Items list are made markdown compatible (old files updated automatically on
296+
load)
296297

297298
==============================================================================
298299
8. Credits *VimTodoListsCredits*

plugin/vim-todo-lists.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ function! VimTodoListsInit()
5050
call VimTodoListsSetItemMode()
5151
endif
5252

53+
call VimTodoListsMigrate()
54+
5355
endfunction
5456

5557

@@ -423,6 +425,13 @@ function! VimTodoListsDecreaseIndent()
423425
normal! <<
424426
endfunction
425427

428+
" Migrates file to new format
429+
function! VimTodoListsMigrate()
430+
normal! mz
431+
silent! execute ':%s/^\(\s*\)\(\[.\]\)/\1- \2/'
432+
normal! 'z
433+
endfunction
434+
426435
"Plugin startup code
427436
if !exists('g:vimtodolists_plugin')
428437
let g:vimtodolists_plugin = 1

0 commit comments

Comments
 (0)