" plugin to handle the TaskPaper to-do list format " Language: Taskpaper (http://hogbaysoftware.com/projects/taskpaper) " Maintainer: David O'Callaghan " URL: https://github.com/davidoc/taskpaper.vim " Last Change: 2012-02-20 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo&vim " Define a default date format if !exists('g:task_paper_date_format') let g:task_paper_date_format = "%Y-%m-%d" endif " Define a default archive project name if !exists('g:task_paper_archive_project') let g:task_paper_archive_project = "Archive" endif " When moving a task, should the cursor follow or stay in the same place " (default: follow) if !exists('g:task_paper_follow_move') let g:task_paper_follow_move = 1 endif " Hide @done tasks when searching tags if !exists('g:task_paper_search_hide_done') let g:task_paper_search_hide_done = 0 endif " Add '@' to keyword character set so that we can complete contexts as keywords setlocal iskeyword+=@-@ " Tab character has special meaning on TaskPaper setlocal noexpandtab " Change 'comments' and 'formatoptions' to continue to write a task item setlocal comments=b:- setlocal fo-=c fo+=rol " Set 'autoindent' to maintain indent level setlocal autoindent " Set up mappings if !exists("no_plugin_maps") && !exists("no_taskpaper_maps") nnoremap TaskPaperFoldProjects \ :call taskpaper#fold_projects() nnoremap TaskPaperFoldNotes \ :call taskpaper#search('\v^(\s*\|\t+-\s+.*\|.+:)$') nnoremap TaskPaperFocusProject \ :call taskpaper#focus_project() nnoremap TaskPaperSearchKeyword \ :call taskpaper#search() nnoremap TaskPaperSearchTag \ :call taskpaper#search_tag() nnoremap TaskPaperGoToProject \ :call taskpaper#go_to_project() nnoremap TaskPaperNextProject \ :call taskpaper#next_project() nnoremap TaskPaperPreviousProject \ :call taskpaper#previous_project() nnoremap TaskPaperArchiveDone \ :call taskpaper#archive_done() nnoremap TaskPaperShowToday \ :call taskpaper#search_tag('today') nnoremap TaskPaperShowCancelled \ :call taskpaper#search_tag('cancelled') nnoremap TaskPaperToggleCancelled \ :call taskpaper#toggle_tag('cancelled', taskpaper#date()) nnoremap TaskPaperToggleDone \ :call taskpaper#toggle_tag('done', taskpaper#date()) nnoremap TaskPaperToggleToday \ :call taskpaper#toggle_tag('today', '') nnoremap TaskPaperMoveToProject \ :call taskpaper#move_to_project() nnoremap TaskPaperNewline \ o=taskpaper#newline() inoremap TaskPaperNewline \ =taskpaper#newline() nmap tp TaskPaperFoldProjects nmap t. TaskPaperFoldNotes nmap tP TaskPaperFocusProject nmap t/ TaskPaperSearchKeyword nmap ts TaskPaperSearchTag nmap tg TaskPaperGoToProject nmap tj TaskPaperNextProject nmap tk TaskPaperPreviousProject nmap tD TaskPaperArchiveDone nmap tT TaskPaperShowToday nmap tX TaskPaperShowCancelled nmap td TaskPaperToggleDone nmap tt TaskPaperToggleToday nmap tx TaskPaperToggleCancelled nmap tm TaskPaperMoveToProject if mapcheck("o", "n") == '' nmap o TaskPaperNewline endif if mapcheck("\", "i") == '' imap TaskPaperNewline endif endif let &cpo = s:save_cpo