" Check VIM version if version < 704 echoerr "Taskwiki requires at least Vim 7.4. Please upgrade your environment." finish endif " Check presence of the python support if ! has("python") echoerr "Taskwiki requires Vim compiled with the Python support." finish endif " Disable taskwiki if taskwiki_disable variable set if exists("g:taskwiki_disable") finish endif " Determine the plugin path let s:plugin_path = escape(expand(':p:h:h'), '\') " Run the measure parts first, if desired if exists("g:taskwiki_measure_coverage") execute 'pyfile ' . s:plugin_path . '/taskwiki/coverage.py' endif " Execute the main body of taskwiki source execute 'pyfile ' . s:plugin_path . '/taskwiki/taskwiki.py' augroup taskwiki autocmd! " Update to TW upon saving execute "autocmd BufWrite *.".expand('%:e')." TaskWikiBufferSave" " Save and load the view to preserve folding execute "autocmd BufWinLeave *.".expand('%:e')." mkview" execute "autocmd BufWinEnter *.".expand('%:e')." silent loadview" augroup END " Global update commands command! -nargs=* TaskWikiBufferSave :py WholeBuffer.update_to_tw() command! -nargs=* TaskWikiBufferLoad :py WholeBuffer.update_from_tw() " Split reports commands command! -nargs=* TaskWikiProjects :py SplitProjects().execute() command! -nargs=* TaskWikiProjectsSummary :py SplitSummary().execute() command! -nargs=* TaskWikiBurndownDaily :py SplitBurndownDaily().execute() command! -nargs=* TaskWikiBurndownMonthly :py SplitBurndownMonthly().execute() command! -nargs=* TaskWikiBurndownWeekly :py SplitBurndownWeekly().execute() command! -nargs=* TaskWikiCalendar :py SplitCalendar().execute() command! -nargs=* TaskWikiGhistoryAnnual :py SplitGhistoryAnnual().execute() command! -nargs=* TaskWikiGhistoryMonthly :py SplitGhistoryMonthly().execute() command! -nargs=* TaskWikiHistoryAnnual :py SplitHistoryAnnual().execute() command! -nargs=* TaskWikiHistoryMonthly :py SplitHistoryMonthly().execute() command! -nargs=* TaskWikiStats :py SplitStats().execute() command! -nargs=* TaskWikiTags :py SplitTags().execute() " Commands that operate on tasks in the buffer command! -range TaskWikiInfo :,py SelectedTasks().info() command! -range TaskWikiEdit :,py SelectedTasks().edit() command! -range TaskWikiLink :,py SelectedTasks().link() command! -range TaskWikiGrid :,py SelectedTasks().grid() command! -range TaskWikiDelete :,py SelectedTasks().delete() command! -range TaskWikiStart :,py SelectedTasks().start() command! -range TaskWikiStop :,py SelectedTasks().stop() command! -range TaskWikiDone :,py SelectedTasks().done() command! -range -nargs=* TaskWikiSort :,py SelectedTasks().sort() command! -range -nargs=* TaskWikiMod :,py SelectedTasks().modify() command! -range -nargs=* TaskWikiAnnotate :,py SelectedTasks().annotate() " Interactive commands command! -range TaskWikiChooseProject :,py ChooseSplitProjects("global").execute() command! -range TaskWikiChooseTag :,py ChooseSplitTags("global").execute() " Meta commands command! TaskWikiInspect :py Meta().inspect_viewport() " Disable as VimwikiFollowLink if !hasmapto('VimwikiFollowLink') nmap NoVimwikiFollowLink VimwikiFollowLink endif nmap :py Mappings.task_info_or_vimwiki_follow_link() " Leader-related mappings. Mostly t + nmap ta :TaskWikiAnnotate nmap tbd :TaskWikiBurndownDaily nmap tbw :TaskWikiBurndownWeekly nmap tbm :TaskWikiBurndownMonthly nmap tcp :TaskWikiChooseProject nmap tct :TaskWikiChooseTag nmap tC :TaskWikiCalendar nmap td :TaskWikiDone nmap tD :TaskWikiDelete nmap te :TaskWikiEdit nmap tg :TaskWikiGrid nmap tGm :TaskWikiGhistoryMonthly nmap tGa :TaskWikiGhistoryAnnual nmap thm :TaskWikiHistoryMonthly nmap tha :TaskWikiHistoryAnnual nmap ti :TaskWikiInfo nmap tl :TaskWikiLink nmap tm :TaskWikiMod nmap tp :TaskWikiProjects nmap ts :TaskWikiProjectsSummary nmap tS :TaskWikiStats nmap tt :TaskWikiTags nmap t+ :TaskWikiStart nmap t- :TaskWikiStop " Mappings for visual mode. vmap ta :TaskWikiAnnotate vmap tcp :TaskWikiChooseProject vmap tct :TaskWikiChooseTag vmap td :TaskWikiDone vmap tD :TaskWikiDelete vmap te :TaskWikiEdit vmap tg :TaskWikiGrid vmap ti :TaskWikiInfo vmap tl :TaskWikiLink vmap tm :TaskWikiMod vmap t+ :TaskWikiStart vmap t- :TaskWikiStop