" File: todo.txt.vim " Description: Todo.txt filetype detection " Author: Leandro Freitas " Licence: Vim licence " Website: http://github.com/freitass/todo.txt.vim " Version: 0.4 " Save context {{{1 let s:save_cpo = &cpo set cpo&vim " General options {{{1 " Some options lose their values when window changes. They will be set every " time this script is invocated, which is whenever a file of this type is " created or edited. setlocal textwidth=0 setlocal wrapmargin=0 " Functions {{{! function! s:TodoTxtRemovePriority() :s/^(\w)\s\+//ge endfunction function! TodoTxtPrependDate() normal! 0"=strftime("%Y-%m-%d ") P endfunction function! TodoTxtMarkAsDone() call s:TodoTxtRemovePriority() call TodoTxtPrependDate() normal! Ix endfunction function! TodoTxtMarkAllAsDone() :g!/^x /:call TodoTxtMarkAsDone() endfunction function! TodoTxtRemoveCompleted() :g/^x /d endfunction " Mappings {{{1 " Sort tasks {{{2 if !hasmapto("s",'n') nnoremap