mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-16 13:53:47 -05:00
Fixes #13, also a little bit of refactoring
This commit is contained in:
@@ -18,18 +18,17 @@ setlocal wrapmargin=0
|
||||
|
||||
" Functions {{{!
|
||||
function! s:TodoTxtRemovePriority()
|
||||
normal! da)
|
||||
:s/^\s\+//g
|
||||
:s/^(\w)\s\+//ge
|
||||
endfunction
|
||||
|
||||
function! s:TodoTxtPrependDate()
|
||||
function! TodoTxtPrependDate()
|
||||
normal! 0"=strftime("%Y-%m-%d ")
|
||||
P
|
||||
endfunction
|
||||
|
||||
function! TodoTxtMarkAsDone()
|
||||
call s:TodoTxtRemovePriority()
|
||||
call s:TodoTxtPrependDate()
|
||||
call s:TodoTxtRemovePriority()
|
||||
call TodoTxtPrependDate()
|
||||
normal! Ix
|
||||
endfunction
|
||||
|
||||
@@ -39,16 +38,16 @@ if !hasmapto("<leader>s",'n')
|
||||
nnoremap <script> <silent> <buffer> <leader>s :sort<CR>
|
||||
endif
|
||||
|
||||
" Insert date {{{2
|
||||
if !hasmapto("<leader>d",'n')
|
||||
nnoremap <script> <silent> <buffer> <leader>d 0"=strftime("%Y-%m-%d ")<CR>P
|
||||
endif
|
||||
" Insert date {{{2
|
||||
if !hasmapto("date<Tab>",'i')
|
||||
inoremap <script> <silent> <buffer> date<Tab> <C-R>=strftime("%Y-%m-%d")<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<leader>d",'n')
|
||||
nnoremap <script> <silent> <buffer> <leader>d :call TodoTxtPrependDate()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<leader>d",'v')
|
||||
if !hasmapto("<leader>d",'v')
|
||||
vnoremap <script> <silent> <buffer> <leader>d :call TodoTxtPrependDate()<CR>
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user