From dd5090adb01955c1b603c7a54aad0eb2c97d3299 Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Wed, 30 Oct 2013 15:07:41 +0700 Subject: [PATCH 1/5] Fix variable name in doc --- doc/vikitasks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/vikitasks.txt b/doc/vikitasks.txt index dda7330..69dd0b8 100755 --- a/doc/vikitasks.txt +++ b/doc/vikitasks.txt @@ -36,7 +36,7 @@ bar.txt: > #C 2009-12-24 Wish @Bernie good luck #D 2009-11-01 Do that -Let's assume you have added both files to |g:vikitasks_files|. Switch to +Let's assume you have added both files to |g:vikitasks#files|. Switch to the buffer foo.txt and call > :VikiTasks From a33af0b1ea40183ce48adf03787875f47ecdc9ef Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Sat, 16 Nov 2013 15:09:46 +0700 Subject: [PATCH 2/5] Grammar tweaks --- doc/vikitasks.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/vikitasks.txt b/doc/vikitasks.txt index 69dd0b8..207985e 100755 --- a/doc/vikitasks.txt +++ b/doc/vikitasks.txt @@ -60,7 +60,7 @@ If you had called > only the first two items would be listed. This week's tasks (i.e. the tasks that should be accomplished today or -within the following six days) could be listed with > +within the following six days) can be listed with > :VikiTasks 6 @@ -73,8 +73,8 @@ Edit the vba file and type: > :so % See :help vimball for details. If you have difficulties or use vim 7.0, -please make sure, you have the current version of vimball -(vimscript #1502) installed or update your runtime. +please make sure that you have the current version of vimball +(vimscript #1502) installed, or update your runtime. This script requires tlib (vimscript #1863), trag (vimscript #2033), and viki (vimscript #861) to be installed. From e42feea29d2f697a7fbe5b36acae8c069149b4d8 Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Sat, 16 Nov 2013 15:18:14 +0700 Subject: [PATCH 3/5] Doc edits and rename three functions Change: TLet g:vikitasks#sources = {... Reason: Keep on one line for generated docs to show default. Change: s/vikitasks#ItemMarkDueInDays/vikitasks#ItemsMarkDueInDays/ s/vikitasks#ItemMarkDueInWeeks/vikitasks#ItemsMarkDueInWeeks/ s/vikitasks#MarkItemDuInDays/vikitasks#ItemMarkDueInDays/ Reason: - name functions that deal with many items with the plural - MarkItemDuInDays was misspelled; while fixing that change to follow the same pattern as the plural functions. --- autoload/vikitasks.vim | 48 ++++++++++++++++++------------------- doc/vikitasks.txt | 4 ++-- ftplugin/viki/vikitasks.vim | 4 ++-- plugin/vikitasks.vim | 29 +++++++++++----------- 4 files changed, 41 insertions(+), 44 deletions(-) diff --git a/autoload/vikitasks.vim b/autoload/vikitasks.vim index ebac363..4307b51 100755 --- a/autoload/vikitasks.vim +++ b/autoload/vikitasks.vim @@ -5,12 +5,12 @@ " @Revision: 1100 -" A list of glob patterns (or files) that will be searched for task -" lists. +" A list of glob patterns (or files) to search for task lists. " Can be buffer-local. " If you add ! to 'viminfo', this variable will be automatically saved " between editing sessions. -" Alternatively, add new items in ~/vimfiles/after/plugin/vikitasks.vim +" Alternatively, add new items in the *after-directory* in 'runtimepath' +" (e.g. ~/vimfiles/after/plugin/vikitasks.vim) TLet g:vikitasks#files = [] " A list of |regexp| patterns for filenames that should not be @@ -33,15 +33,12 @@ TLet g:vikitasks#ignore_completed_tasks = 1 TLet g:vikitasks#intervikis_ignored = [] " If you use todo.txt (http://todotxt.com), set this variable to the -" full name of base directory where todo.txt is kept. -" For display, lines in todo.txt are converted to viki task list syntax. +" full name of the base directory where todo.txt is kept. +" Lines in todo.txt are converted to the viki task list syntax for display. TLet g:vikitasks#todotxt_dir = '' " If true, provide tighter integration with the vim viki plugin. -TLet g:vikitasks#sources = { - \ 'viki': exists('g:loaded_viki'), - \ 'todotxt': !empty(g:vikitasks#todotxt_dir) - \ } +TLet g:vikitasks#sources = {'viki': exists('g:loaded_viki'), 'todotxt': !empty(g:vikitasks#todotxt_dir)} " Default category/priority when converting tasks without priorities. TLet g:vikitasks#default_priority = 'F' @@ -114,7 +111,7 @@ TLet g:vikitasks#inputlist_params = { \ } \ } -" Mapleader for some vikitasks related maps. +" Mapleader for some vikitasks-related mappings. TLet g:vikitasks#mapleader = 't' " If true, add a date tag when marking a task done with |vikitasks#ItemMarkDone()|. @@ -124,7 +121,7 @@ TLet g:vikitasks#done_add_date = 1 " archived tasks should be moved to. TLet g:vikitasks#archive_filename_expr = 'expand("%:p:r") ."_archived". g:vikiNameSuffix' -" A list of strings. The header for newly created tasks archives. +" A list of strings. The header for newly created task archives. TLet g:vikitasks#archive_header = ['* Archived tasks'] " The date format string (see |strftime()|) for archived entries. @@ -151,8 +148,9 @@ TLet g:vikitasks#use_calendar = '' " TLet g:vikitasks#use_calendar = exists(':Calendar') ? 'Calendar' : '' " Define how to format the list when calling |:VikiTasksPaste|. -" A dictionary with the fields (default values are marked with "*"): -" filename: add*|group|none +" A dictionary {'filename': mode} where mode can be 'add' or 'group'. +" The 'group' mode groups tasks under source filenames; +" the 'add' mode (default) adds tasks together with their source filename. TLet g:vikitasks#paste = {} @@ -433,8 +431,8 @@ function! s:View(index, suspend) "{{{3 endf -" 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 +" If the |regexp| PATTERN seems to be a word, |\<| is prepended. +" The PATTERN is case-sensitive if it contains an upper-case letter " and if 'smartcase' is true. function! s:MakePattern(pattern) "{{{3 let pattern = a:pattern @@ -840,7 +838,7 @@ function! vikitasks#ScanCurrentBuffer(...) "{{{3 endf -" Mark a N tasks as done, i.e. assign them to category X -- see also +" Mark N tasks as done, i.e. assign them to category X -- see also " |g:vikitasks#final_categories|. function! vikitasks#ItemMarkDone(count) "{{{3 let rx = s:TasksRx('tasks') @@ -868,7 +866,7 @@ function! vikitasks#ItemMarkDone(count) "{{{3 endf -" Archive final (see |g:vikitasks#final_categories|) tasks. +" Archive finalized (see |g:vikitasks#final_categories|) tasks. function! vikitasks#ItemArchiveFinal() "{{{3 if empty(g:vikitasks#archive_filename_expr) echom "vikitasks: Cannot archive tasks: g:vikitasks#archive_filename_expr is empty" @@ -912,18 +910,18 @@ function! vikitasks#ListTaskFiles() "{{{3 endf -" Mark a tasks as due in N days. -function! vikitasks#ItemMarkDueInDays(count, days) "{{{3 +" Mark task(s) as due in N days. +function! vikitasks#ItemsMarkDueInDays(count, days) "{{{3 " TLogVAR a:count, a:days let duedate = strftime('%Y-%m-%d', localtime() + a:days * g:tlib#date#dayshift) for lnum in range(line('.'), line('.') + a:count) - call vikitasks#MarkItemDuInDays(lnum, duedate) + call vikitasks#ItemMarkDueInDays(lnum, duedate) endfor endf " :nodoc: -function! vikitasks#MarkItemDuInDays(lnum, duedate) "{{{3 +function! vikitasks#ItemMarkDueInDays(lnum, duedate) "{{{3 " TLogVAR bufname('%'), a:lnum, a:duedate let rx = s:TasksRx('tasks') let line = getline(a:lnum) @@ -942,10 +940,10 @@ function! vikitasks#MarkItemDuInDays(lnum, duedate) "{{{3 endf -" Mark a tasks as due in N weeks. -function! vikitasks#ItemMarkDueInWeeks(count, weeks) "{{{3 +" Mark task(s) as due in N weeks. +function! vikitasks#ItemsMarkDueInWeeks(count, weeks) "{{{3 " TLogVAR a:count, a:weeks - call vikitasks#ItemMarkDueInDays(a:count, a:weeks * 7) + call vikitasks#ItemsMarkDueInDays(a:count, a:weeks * 7) endf @@ -1047,7 +1045,7 @@ function! vikitasks#CalendarCallback(day, month, year, week, dir) "{{{3 let duedate = printf('%4d-%02d-%02d', a:year, a:month, a:day) " TLogVAR duedate let world = trag#RunCmdOnSelected(s:calendar_callback_world, s:calendar_callback_selected, - \ printf('call vikitasks#MarkItemDuInDays(line("."), %s)', string(duedate)), 0) + \ printf('call vikitasks#ItemMarkDueInDays(line("."), %s)', string(duedate)), 0) " TLogVAR world.state call setbufvar(s:calendar_callback_buffer, 'tlib_world', world) exec s:calendar_callback_window 'wincmd w' diff --git a/doc/vikitasks.txt b/doc/vikitasks.txt index 207985e..e5ff3b4 100755 --- a/doc/vikitasks.txt +++ b/doc/vikitasks.txt @@ -131,8 +131,8 @@ Contents~ vikitasks#ItemMarkDone ................ |vikitasks#ItemMarkDone()| vikitasks#ItemArchiveFinal ............ |vikitasks#ItemArchiveFinal()| vikitasks#ListTaskFiles ............... |vikitasks#ListTaskFiles()| - vikitasks#ItemMarkDueInDays ........... |vikitasks#ItemMarkDueInDays()| - vikitasks#ItemMarkDueInWeeks .......... |vikitasks#ItemMarkDueInWeeks()| + vikitasks#ItemsMarkDueInDays ........... |vikitasks#ItemMarkDueInDays()| + vikitasks#ItemsMarkDueInWeeks .......... |vikitasks#ItemMarkDueInWeeks()| vikitasks#ItemChangeCategory .......... |vikitasks#ItemChangeCategory()| diff --git a/ftplugin/viki/vikitasks.vim b/ftplugin/viki/vikitasks.vim index 37060fe..5cb4e2e 100644 --- a/ftplugin/viki/vikitasks.vim +++ b/ftplugin/viki/vikitasks.vim @@ -6,7 +6,7 @@ exec 'noremap ' g:vikitasks#mapleader.'x' ':call vikitasks#ItemMarkDone(v:count)' exec 'noremap ' g:vikitasks#mapleader.'a' ':call vikitasks#ItemArchiveFinal()' exec 'noremap ' g:vikitasks#mapleader.'l' ':call vikitasks#ListTaskFiles()' -exec 'noremap ' g:vikitasks#mapleader.'d' ':call vikitasks#ItemMarkDueInDays(0, v:count)' -exec 'noremap ' g:vikitasks#mapleader.'w' ':call vikitasks#ItemMarkDueInWeeks(0, v:count1)' +exec 'noremap ' g:vikitasks#mapleader.'d' ':call vikitasks#ItemsMarkDueInDays(0, v:count)' +exec 'noremap ' g:vikitasks#mapleader.'w' ':call vikitasks#ItemsMarkDueInWeeks(0, v:count1)' exec 'noremap ' g:vikitasks#mapleader.'c' ':call vikitasks#ItemChangeCategory(v:count)' diff --git a/plugin/vikitasks.vim b/plugin/vikitasks.vim index af5c030..c620855 100755 --- a/plugin/vikitasks.vim +++ b/plugin/vikitasks.vim @@ -42,11 +42,11 @@ TLet g:vikitasks_startup_alarms = (!has('clientserver') || len(split(serverlist( 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: +" CONSTRAINT constrains which tasks should be displayed. Possible values +" are: " " today ... Show tasks that are due today -" current ... Show pending and today's tasks +" current ... Show today's tasks and pending 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 (i.e. 7 days) @@ -59,12 +59,11 @@ TLet g:vikitasks_scan_events = 'BufWritePost,BufWinEnter' " " The default value for CONSTRAINT is ".". " -" If N is prepended with + (e.g. "+2w"), tasks with a deadline in the -" past are hidden. +" Prepend + to N (e.g. "+2w") to hide tasks with a deadline in the past. " -" If N is prepended with - (e.g. "-2w"), only tasks with a deadline in -" the past (in this example in the last two weeks) are shown. This -" implies showing all tasks as with "*". +" Prepend - to N (e.g. "-2w") to show only tasks with a deadline in +" the past (in this example in the last two weeks). This implies showing +" all tasks, as with "*". " " If CONSTRAINT doesn't match one of the constraints described above, it " is assumed to be a PATTERN -- see also |viki-tasks|. @@ -93,19 +92,19 @@ TLet g:vikitasks_scan_events = 'BufWritePost,BufWinEnter' " :VikiTasks current Notes*.txt command! -bang -nargs=* VikiTasks call vikitasks#Tasks(vikitasks#GetArgs(!empty(""), []), 0) -" The same as |:VikiTasks| but the tasks list doesn't take the focus. +" The same as |:VikiTasks| but the tasks list doesn't take focus. command! -bang -nargs=* VikiTasksStatic call vikitasks#Tasks(vikitasks#GetArgs(!empty(""), []), 1) " cabbr vikitasks VikiTasks " :display: :VikiTasksPaste[!] [ARGUMENTS...] -" Paste the results of a VIKITASKSCOMMAND (default: VikiTasks) in a +" Paste the results of a VIKITASKSCOMMAND (default: |:VikiTasks|) in a " buffer. When called with a |bang| [!], create a new buffer. See " |:VikiTasks| for the allowed ARGUMENTS. command! -bang -nargs=* VikiTasksPaste call vikitasks#Paste(!empty(""), vikitasks#GetArgs(0, [])) " :display: :[count]VikiTasksAlarms " Display a list of alarms. Shows alarms due within N days. -" If N is -1, uses |g:vikitasks#alarms| if any. +" If N is -1, uses |g:vikitasks#alarms|, if any. command! -count VikiTasksAlarms call vikitasks#Alarm() " :display: :VikiTasksAdd @@ -117,7 +116,7 @@ command! VikiTasksAdd call vikitasks#AddBuffer(expand('%:p')) command! -count=0 VikiTasksDone call vikitasks#ItemMarkDone() -" Archive final (see |g:vikitasks#final_categories|) tasks. +" Archive finalized tasks (see |g:vikitasks#final_categories|). command! VikiTasksArchive call vikitasks#ItemArchiveFinal() @@ -134,12 +133,12 @@ command! VikiTasksFiles call vikitasks#ListTaskFiles() " :display: :[count]VikiTasksDueInDays [DAYS=0] " Mark [count] task(s) as due in N days. -command! -range -nargs=? VikiTasksDueInDays ,call vikitasks#ItemMarkDueInDays(, 0 + ) +command! -range -nargs=? VikiTasksDueInDays ,call vikitasks#ItemsMarkDueInDays(, 0 + ) -" :display: :[count]VikiTasksDueInDays [WEEKS=1] +" :display: :[count]VikiTasksDueInWeeks [WEEKS=1] " Mark [count] task(s) as due in N weeks. -command! -range -nargs=? VikiTasksDueInWeeks ,call vikitasks#ItemMarkDueInWeeks(, (0 + ) == 0 ? 1 : 0 + ) +command! -range -nargs=? VikiTasksDueInWeeks ,call vikitasks#ItemsMarkDueInWeeks(, (0 + ) == 0 ? 1 : 0 + ) augroup VikiTasks From 45a117018b1234f18e0a08d47a5fc37c9262fe15 Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Mon, 29 Dec 2014 12:12:30 +0200 Subject: [PATCH 4/5] intervikis config went to vikitasks#ft#viki#intervikis TODO: document using the new name --- autoload/vikitasks.vim | 7 ------- 1 file changed, 7 deletions(-) diff --git a/autoload/vikitasks.vim b/autoload/vikitasks.vim index cd24775..1b1eafe 100755 --- a/autoload/vikitasks.vim +++ b/autoload/vikitasks.vim @@ -21,13 +21,6 @@ TLet g:vikitasks#files = [] TLet g:vikitasks#files_ignored = ['_archived\.[^.]\+$'] let s:files_ignored = join(g:vikitasks#files_ignored, '\|') -" If non-null, automatically add the homepages of your intervikis to -" |g:vikitasks#files|. -" If the value is 2, scan all files (taking into account the interviki -" suffix) in the interviki's top directory. -" Can be buffer-local. -TLet g:vikitasks#intervikis = 0 - " If true, completely ignore completed tasks. TLet g:vikitasks#ignore_completed_tasks = 1 From df5f8a66b686efbd502887c11cd1ba03acee7be1 Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Mon, 29 Dec 2014 12:17:19 +0200 Subject: [PATCH 5/5] intervikis config moved --- doc/vikitasks.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/doc/vikitasks.txt b/doc/vikitasks.txt index 9ed6376..14b4428 100755 --- a/doc/vikitasks.txt +++ b/doc/vikitasks.txt @@ -173,14 +173,6 @@ g:vikitasks#files_ignored (default: ['_archived\.[^.]\+$']) A list of |regexp| patterns for filenames that should not be scanned. - *g:vikitasks#intervikis* -g:vikitasks#intervikis (default: 0) - If non-null, automatically add the homepages of your intervikis to - |g:vikitasks#files|. - If the value is 2, scan all files (taking into account the interviki - suffix) in the interviki's top directory. - Can be buffer-local. - *g:vikitasks#ignore_completed_tasks* g:vikitasks#ignore_completed_tasks (default: 1) If true, completely ignore completed tasks.