Skip to content

Commit

Permalink
Inherit list marker when create new todo at start of the line
Browse files Browse the repository at this point in the history
When create a new todo at start of the line, ensure the list marker is
inherited from the line above.
  • Loading branch information
vitalk committed Jul 18, 2015
1 parent 486508a commit 5c20cb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/simple-todo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ nnore <Plug>(simple-todo-new) i[ ]<space>
inore <Plug>(simple-todo-new) [ ]<space>

" Create a new item at the start of this line
inore <Plug>(simple-todo-new-start-of-line) <Esc>mzI[ ]<space><Esc>`z4la
nnore <Plug>(simple-todo-new-start-of-line) mzI[ ]<space><Esc>`z4l
vnore <Plug>(simple-todo-new-start-of-line) I[ ]<space>
inore <Plug>(simple-todo-new-start-of-line) <Esc>mzI<c-r>=<SID>get_list_marker(line('.')-1)<cr>[ ]<space><Esc>`z4la
nnore <Plug>(simple-todo-new-start-of-line) mzI<c-r>=<SID>get_list_marker(line('.')-1)<cr>[ ]<space><Esc>`z4l
vnore <Plug>(simple-todo-new-start-of-line) I<c-r>=<SID>get_list_marker(line('.')-1)<cr>[ ]<space>

" Create a new item below
nnore <Plug>(simple-todo-below) o<c-r>=<SID>get_list_marker(line('.')-1)<cr>[ ]<space>
Expand Down

0 comments on commit 5c20cb7

Please sign in to comment.