Browse files

Version 0.04

- s:GetCurrentTask(): skip pending tasks (date = '_')- VikiTasksStatic (by tub78)- .gitignore- Don't check for has('vim_starting')MD5 checksum: 2f8c5fc7e4399d35f9f0a8b9a4ea9fef
  • Loading branch information...
1 parent 7b05e63 commit 6b141a6d88b2fc7c32926036e6ba2dee5020c814 @tomtom tomtom committed with Jan 21, 2012
Showing with 43 additions and 42 deletions.
  1. +2 −0 README
  2. +19 −14 autoload/vikitasks.vim
  3. +16 −1 doc/vikitasks.txt
  4. +6 −27 plugin/vikitasks.vim
View
2 README
@@ -7,6 +7,8 @@ of intervikis or search only project-specific files. Buffers
containing task lists are added to the list of vikitasks. There is
also an option to view a list of current tasks on startup.
+Demo:
+http://vimsomnia.blogspot.com/2010/11/vikitasks-viki-demonstration-personal.html
Usage:
:VikiTasks[!] [CONSTRAINT] [PATTERN] [FILE_PATTERNS]
View
33 autoload/vikitasks.vim
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2009-12-13.
-" @Last Change: 2010-11-06.
-" @Revision: 0.0.664
+" @Last Change: 2011-12-25.
+" @Revision: 0.0.678
" A list of glob patterns (or files) that will be searched for task
@@ -67,6 +67,15 @@ TLet g:vikitasks#use_unspecified_dates = 0
" If true, remove unreadable files from the tasks list.
TLet g:vikitasks#remove_unreadable_files = 1
+" The parameters for |:TRagcw| when |g:vikitasks#qfl_viewer| is empty.
+" :read: TLet g:vikitasks#inputlist_params = {...}
+TLet g:vikitasks#inputlist_params = {
+ \ 'trag_list_syntax': 'viki',
+ \ 'trag_list_syntax_nextgroup': '@vikiPriorityListTodo',
+ \ 'trag_short_filename': 1,
+ \ 'scratch': '__VikiTasks__'
+ \ }
+
function! s:VikitasksRx(inline, sometasks, letters, levels) "{{{3
let val = '\C^[[:blank:]]'. (a:inline ? '*' : '\+') .'\zs'.
@@ -109,16 +118,16 @@ function! vikitasks#GetArgs(bang, list) "{{{3
endf
-" :display: vikitasks#Tasks(?{'all_tasks': 0, 'cached': 1, 'files': [], 'constraint': '', 'rx': ''})
+" :display: vikitasks#Tasks(?{'all_tasks': 0, 'cached': 1, 'files': [], 'constraint': '', 'rx': ''}, ?suspend=0)
" If files is non-empty, use these files (glob patterns actually)
" instead of those defined in |g:vikitasks#files|.
function! vikitasks#Tasks(...) "{{{3
- TVarArg ['args', {}]
+ TVarArg ['args', {}], ['suspend', 0]
if get(args, 'cached', 1)
let qfl = copy(s:Tasks())
- call s:TasksList(qfl, args)
+ call s:TasksList(qfl, args, suspend)
else
@@ -154,7 +163,7 @@ function! vikitasks#Tasks(...) "{{{3
endfor
call s:SaveInfo(s:Files(), tasks)
- call s:TasksList(qfl, args)
+ call s:TasksList(qfl, args, suspend)
else
echom "VikiTasks: No task files"
endif
@@ -163,12 +172,12 @@ function! vikitasks#Tasks(...) "{{{3
endf
-function! s:TasksList(qfl, args) "{{{3
+function! s:TasksList(qfl, args, suspend) "{{{3
call s:FilterTasks(a:qfl, a:args)
call sort(a:qfl, "s:SortTasks")
call setqflist(a:qfl)
let i = s:GetCurrentTask(a:qfl, 0)
- call s:View(i, 0)
+ call s:View(i, a:suspend)
endf
@@ -248,14 +257,10 @@ endf
function! s:View(index, suspend) "{{{3
if empty(g:vikitasks#qfl_viewer)
- let w = {}
+ let w = deepcopy(g:vikitasks#inputlist_params)
if a:index > 1
let w.initial_index = a:index
endif
- let w.trag_list_syntax = 'viki'
- let w.trag_list_syntax_nextgroup = '@vikiPriorityListTodo'
- let w.trag_short_filename = 1
- let w.scratch = '__VikiTasks__'
call trag#QuickList(w, a:suspend)
else
exec g:vikitasks#qfl_viewer
@@ -307,7 +312,7 @@ function! s:GetCurrentTask(qfl, daysdiff) "{{{3
for qi in a:qfl
let qid = s:GetTaskDueDate(qi.text, 1, g:vikitasks#use_unspecified_dates)
" TLogVAR qid, today
- if !empty(qid) && tlib#date#DiffInDays(qid, today, 1) <= a:daysdiff
+ if !empty(qid) && qid != '_' && tlib#date#DiffInDays(qid, today, 1) <= a:daysdiff
let i += 1
else
break
View
17 doc/vikitasks.txt
@@ -17,6 +17,8 @@ Features:
- Browse tasks with a given date
- Optionally browse all tasks (incl. those without a date)
+Demo:
+http://vimsomnia.blogspot.com/2010/11/vikitasks-viki-demonstration-personal.html
-----------------------------------------------------------------------
Tutorial: How does it work?~
@@ -86,6 +88,7 @@ Contents~
g:vikitasks_startup_alarms ............ |g:vikitasks_startup_alarms|
g:vikitasks_scan_events ............... |g:vikitasks_scan_events|
:VikiTasks ............................ |:VikiTasks|
+ :VikiTasksStatic ...................... |:VikiTasksStatic|
:VikiTasksAdd ......................... |:VikiTasksAdd|
:VikiTasksFiles ....................... |:VikiTasksFiles|
:VikiTasksAlarms ...................... |:VikiTasksAlarms|
@@ -101,6 +104,8 @@ Contents~
g:vikitasks#use_end_date .............. |g:vikitasks#use_end_date|
g:vikitasks#use_unspecified_dates ..... |g:vikitasks#use_unspecified_dates|
g:vikitasks#remove_unreadable_files ... |g:vikitasks#remove_unreadable_files|
+ g:vikitasks#inputlist_params .......... |g:vikitasks#inputlist_params|
+ g:vikitasks#inputlist_params .......... |g:vikitasks#inputlist_params|
vikitasks#Tasks ....................... |vikitasks#Tasks()|
vikitasks#AddBuffer ................... |vikitasks#AddBuffer()|
vikitasks#RemoveBuffer ................ |vikitasks#RemoveBuffer()|
@@ -170,6 +175,9 @@ VikiTasks[!] [CONSTRAINT] [PATTERN] [FILE_PATTERNS]
VikiTasks current Notes*.txt
<
+ *:VikiTasksStatic*
+:VikiTasksStatic
+
*:VikiTasksAdd*
:VikiTasksAdd
Add the current buffer to |g:vikitasks#files|.
@@ -256,8 +264,15 @@ g:vikitasks#use_unspecified_dates (default: 0)
g:vikitasks#remove_unreadable_files (default: 1)
If true, remove unreadable files from the tasks list.
+ *g:vikitasks#inputlist_params*
+g:vikitasks#inputlist_params (default: {...})
+ The parameters for |:TRagcw| when |g:vikitasks#qfl_viewer| is empty.
+
+ *g:vikitasks#inputlist_params*
+g:vikitasks#inputlist_params (default: {)
+
*vikitasks#Tasks()*
-vikitasks#Tasks(?{'all_tasks': 0, 'cached': 1, 'files': [], 'constraint': '', 'rx': ''})
+vikitasks#Tasks(?{'all_tasks': 0, 'cached': 1, 'files': [], 'constraint': '', 'rx': ''}, ?suspend=0)
If files is non-empty, use these files (glob patterns actually)
instead of those defined in |g:vikitasks#files|.
View
33 plugin/vikitasks.vim
@@ -3,8 +3,8 @@
" @GIT: http://github.com/tomtom/vikitasks_vim/
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2009-12-13.
-" @Last Change: 2010-11-06.
-" @Revision: 226
+" @Last Change: 2012-01-21.
+" @Revision: 230
" GetLatestVimScripts: 2894 0 :AutoInstall: vikitasks.vim
" Search for task lists and display them in a list
@@ -33,7 +33,7 @@ endif
if &cp || exists("loaded_vikitasks")
finish
endif
-let loaded_vikitasks = 3
+let loaded_vikitasks = 4
let s:save_cpo = &cpo
set cpo&vim
@@ -94,7 +94,8 @@ TLet g:vikitasks_scan_events = 'BufWritePost,BufWinEnter'
" < 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>]))
+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
@@ -115,11 +116,7 @@ command! -count VikiTasksAlarms call vikitasks#Alarm(<count>)
augroup VikiTasks
autocmd!
if g:vikitasks_startup_alarms
- if has('vim_starting')
- autocmd VimEnter * call vikitasks#Alarm()
- else
- call vikitasks#Alarm()
- endif
+ 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'
@@ -130,21 +127,3 @@ augroup END
let &cpo = s:save_cpo
unlet s:save_cpo
-finish
-
-CHANGES:
-
-0.1
-- Initial release
-
-0.2
-- :VikiTasks now takes a pattern as optional second argument. This
-change makes the :VikiTasksGrep command obsolete, which was removed.
-- Moved the definition of some variables from plugin/vikitasks.vim to autoload/vikitasks.vim
-- Scan buffers on save
-- Require tlib 0.37
-- The arguments for :VikiTasks have changed
-
-0.3
-- vikitasks pseudo-mode-line: % vikitasks: letters=A-C:levels=1-3
-

0 comments on commit 6b141a6

Please sign in to comment.