Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.04
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 130 lines (112 sloc) 4.526 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
" @Author: Tom Link (micathom AT gmail com?subject=[vim])
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @GIT: http://github.com/tomtom/vikitasks_vim/
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2009-12-13.
" @Last Change: 2012-01-21.
" @Revision: 230
" GetLatestVimScripts: 2894 0 :AutoInstall: vikitasks.vim
" Search for task lists and display them in a list


if !exists('g:loaded_tlib') || g:loaded_tlib < 39
    runtime plugin/02tlib.vim
    if !exists('g:loaded_tlib') || g:loaded_tlib < 39
        echoerr 'tlib >= 0.39 is required'
        finish
    endif
endif
if !exists('g:loaded_viki') || g:loaded_viki < 319
    runtime plugin/viki.vim
    if !exists('g:loaded_viki') || g:loaded_viki < 319
        echoerr 'viki >= 3.19 is required'
        finish
    endif
endif
if !exists('g:loaded_trag') || g:loaded_trag < 8
    runtime plugin/trag.vim
    if !exists('g:loaded_trag') || g:loaded_trag < 8
        echoerr 'trag >= 0.8 is required'
        finish
    endif
endif
if &cp || exists("loaded_vikitasks")
    finish
endif
let loaded_vikitasks = 4

let s:save_cpo = &cpo
set cpo&vim


" Show alarms on pending tasks.
" If 0, don't display alarms for pending tasks.
" If n > 0, display alarms for pending tasks or tasks with a deadline in n
" days.
TLet g:vikitasks_startup_alarms = !has('clientserver') || len(split(serverlist(), '\n')) <= 1

" Scan a buffer on these events.
TLet g:vikitasks_scan_events = 'BufWritePost,BufWinEnter'

" :display: VikiTasks[!] [CONSTRAINT] [PATTERN] [FILE_PATTERNS]
" CONSTRAINT defined which tasks should be displayed. Possible values
" for CONSTRAINT are:
"
" today ... Show tasks that are due today
" current ... Show pending and today's tasks
" NUMBER (of days) ... Show tasks that are due within N days
" Nd ... Tasks for the next N days
" Nw ... Tasks for the next N weeks
" Nm ... Tasks for the next N months
" week ... Tasks for the next week
" month ... Tasks for the next month
" . ... Show some tasks (see |g:vikitasks#rx_letters|
" and |g:vikitasks#rx_levels|)
" * ... Show all tasks
"
" If N is prepended with + (e.g. "+2w"), tasks with a deadline in the
" past are hidden.
"
" The default value for CONSTRAINT is ".".
"
" If CONSTRAINT starts with "@" or ":" it is assumed to be a PATTERN --
" see also |viki-tasks|.
"
" The |regexp| PATTERN is prepended with |\<| if it seems to be a word.
" The PATTERN is made case sensitive if it contains an upper-case letter
" and if 'smartcase' is true. Only tasks matching the PATTERN will be
" listed. Use "." to match all tasks.
"
" With the optional !, all files are rescanned. Otherwise cached
" information is used. Either scan all known files (|interviki|s and
" pages registered via |:VikiTasksAdd|) or files matching FILE_PATTERNS.
"
" The current buffer has to be a viki buffer. If it isn't, your
" |g:vikiHomePage|, which must be set, is opened first.
"
" Examples:
" Show all cached tasks with a date: >
" VikiTasks
" < Rescan files and show all tasks: >
" VikiTasks!
" < Show all cached tasks for today: >
" VikiTasks today
" < Show all current cached tasks (today or with a deadline in the
" past) in a specified list of files: >
" VikiTasks current Notes*.txt
command! -bang -nargs=* VikiTasks call vikitasks#Tasks(vikitasks#GetArgs(!empty("<bang>"), [<f-args>]), 0)
command! -bang -nargs=* VikiTasksStatic call vikitasks#Tasks(vikitasks#GetArgs(!empty("<bang>"), [<f-args>]), 1)
cabbr vikitasks VikiTasks


" :display: :VikiTasksAdd
" Add the current buffer to |g:vikitasks#files|.
command! VikiTasksAdd call vikitasks#AddBuffer(expand('%:p'))


" :display: :VikiTasksFiles
" Edit |g:vikitasks#files|. This allows you to remove buffers from the
" list.
command! VikiTasksFiles call vikitasks#EditFiles()


command! -count VikiTasksAlarms call vikitasks#Alarm(<count>)


augroup VikiTasks
    autocmd!
    if g:vikitasks_startup_alarms
        autocmd VimEnter * call vikitasks#Alarm()
    endif
    if !empty(g:vikitasks_scan_events)
        exec 'autocmd '. g:vikitasks_scan_events .' * if exists("b:vikiEnabled") && b:vikiEnabled | call vikitasks#ScanCurrentBuffer(expand("<afile>:p")) | endif'
    endif
    unlet g:vikitasks_startup_alarms g:vikitasks_scan_events
augroup END


let &cpo = s:save_cpo
unlet s:save_cpo
Something went wrong with that request. Please try again.