Merge pull request #15 from neoascetic/patch-1

Fixed GitHub issue #13
This commit is contained in:
Leandro Freitas
2014-04-27 10:15:35 -03:00
2 changed files with 10 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
(A) 2011-06-06 Check file syntax @syntax (A) 2011-06-06 Check file syntax @syntax
(B) 2011-05-31 Start documentation @doc (B) 2011-05-31 Start documentation @doc
(C) 2011-06-01 Improve syntax file @syntax (C) 2011-06-01 Improve syntax file @syntax
2011-05-30 Contact main project for reference x 2014-04-27 2011-05-30 Contact main project for reference
X 2011-05-30 Create README.markdown to be published in github @doc X 2011-05-30 Create README.markdown to be published in github @doc
X 2011-05-30 Implement colorized priorities @syntax X 2011-05-30 Implement colorized priorities @syntax
X 2011-05-30 Implement filetype detection @ftdetect X 2011-05-30 Implement filetype detection @ftdetect

View File

@@ -18,18 +18,17 @@ setlocal wrapmargin=0
" Functions {{{! " Functions {{{!
function! s:TodoTxtRemovePriority() function! s:TodoTxtRemovePriority()
normal! da) :s/^(\w)\s\+//ge
:s/^\s\+//g
endfunction endfunction
function! s:TodoTxtPrependDate() function! TodoTxtPrependDate()
normal! 0"=strftime("%Y-%m-%d ") normal! 0"=strftime("%Y-%m-%d ")
P P
endfunction endfunction
function! TodoTxtMarkAsDone() function! TodoTxtMarkAsDone()
call s:TodoTxtRemovePriority() call s:TodoTxtRemovePriority()
call s:TodoTxtPrependDate() call TodoTxtPrependDate()
normal! Ix normal! Ix
endfunction endfunction
@@ -39,16 +38,16 @@ if !hasmapto("<leader>s",'n')
nnoremap <script> <silent> <buffer> <leader>s :sort<CR> nnoremap <script> <silent> <buffer> <leader>s :sort<CR>
endif 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 " Insert date {{{2
if !hasmapto("date<Tab>",'i') if !hasmapto("date<Tab>",'i')
inoremap <script> <silent> <buffer> date<Tab> <C-R>=strftime("%Y-%m-%d")<CR> inoremap <script> <silent> <buffer> date<Tab> <C-R>=strftime("%Y-%m-%d")<CR>
endif 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> vnoremap <script> <silent> <buffer> <leader>d :call TodoTxtPrependDate()<CR>
endif endif