Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

VikiTasksDueInMonths

  • Loading branch information...
commit 4a6ca5f9809fc932b27a54e59915911be04a30bb 1 parent 9d1ad51
@tomtom authored
View
23 autoload/vikitasks.vim
@@ -137,6 +137,7 @@ TLet g:vikitasks#inputlist_params = {
\ char2nr('x') : {'agent': 'vikitasks#AgentMarkDone', 'key_name': 'x', 'help': 'Mark done'},
\ char2nr('d') : {'agent': 'vikitasks#AgentDueDays', 'key_name': 'd', 'help': 'Mark as due in N days'},
\ char2nr('w') : {'agent': 'vikitasks#AgentDueWeeks', 'key_name': 'w', 'help': 'Mark as due in N weeks'},
+ \ char2nr('m') : {'agent': 'vikitasks#AgentDueMonths', 'key_name': 'w', 'help': 'Mark as due in N months'},
\ char2nr('c') : {'agent': 'vikitasks#AgentItemChangeCategory', 'key_name': 'c', 'help': 'Change task category'},
\ char2nr('k') : {'agent': 'vikitasks#AgentSelectCategory', 'key_name': 'k', 'help': 'Select tasks of a category'},
\ 'unknown_key': {'agent': 'tlib#agent#Null', 'key_name': 'other keys', 'help': 'ignore key'},
@@ -1426,6 +1427,14 @@ function! vikitasks#ItemsMarkDueInWeeks(count, weeks) "{{{3
endf
+" Mark task(s) as due in N months,
+" NOTE: A "month" means 30 days.
+function! vikitasks#ItemsMarkDueInMonths(count, months) "{{{3
+ " TLogVAR a:count, a:months
+ call vikitasks#ItemsMarkDueInDays(a:count, a:months * 30)
+endf
+
+
" Change the category for the current and the next a:count tasks.
function! vikitasks#ItemChangeCategory(count, ...) "{{{3
if a:0 >= 1
@@ -1575,6 +1584,20 @@ endf
" :nodoc:
+function! vikitasks#AgentDueMonths(world, selected) "{{{3
+ call inputsave()
+ let val = input("Number of months: ", 1)
+ call inputrestore()
+ if empty(val)
+ let a:world.state = 'redisplay'
+ return a:world
+ else
+ return trag#AgentWithSelected(a:world, a:selected, 'VikiTasksDueInMonths '. val)
+ endif
+endf
+
+
+" :nodoc:
function s:Paste(newbuffer, qfl) "{{{3
let mode_filename = get(g:vikitasks#paste, 'filename', 'add')
let lines = []
View
3  ftplugin/viki/vikitasks.vim
@@ -1,6 +1,6 @@
" @Author: Tom Link (mailto:micathom AT gmail com?s<c-U>ubject=[vim])
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
-" @Last Change: 2013-03-07.
+" @Last Change: 2015-05-12.
" @Revision: 21
exec 'noremap <buffer>' g:vikitasks#mapleader.'x' ':<C-U>call vikitasks#ItemMarkDone(v:count)<cr>'
@@ -8,5 +8,6 @@ exec 'noremap <buffer>' g:vikitasks#mapleader.'a' ':call vikitasks#ItemArchiveFi
exec 'noremap <buffer>' g:vikitasks#mapleader.'l' ':call vikitasks#ListTaskFiles()<cr>'
exec 'noremap <buffer>' g:vikitasks#mapleader.'d' ':<C-U>call vikitasks#ItemsMarkDueInDays(0, v:count)<cr>'
exec 'noremap <buffer>' g:vikitasks#mapleader.'w' ':<C-U>call vikitasks#ItemsMarkDueInWeeks(0, v:count1)<cr>'
+exec 'noremap <buffer>' g:vikitasks#mapleader.'m' ':<C-U>call vikitasks#ItemsMarkDueInMonths(0, v:count1)<cr>'
exec 'noremap <buffer>' g:vikitasks#mapleader.'c' ':<C-U>call vikitasks#ItemChangeCategory(v:count)<cr>'
View
7 plugin/vikitasks.vim
@@ -3,7 +3,7 @@
" @GIT: http://github.com/tomtom/vikitasks_vim/
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2009-12-13.
-" @Last Change: 2015-01-19.
+" @Last Change: 2015-05-12.
" @Revision: 330
" GetLatestVimScripts: 2894 0 :AutoInstall: vikitasks.vim
" Search for task lists and display them in a list
@@ -157,6 +157,11 @@ command! -bar -range -nargs=? VikiTasksDueInDays <line1>,<line2>call vikitasks#I
command! -bar -range -nargs=? VikiTasksDueInWeeks <line1>,<line2>call vikitasks#ItemsMarkDueInWeeks(0, empty(<q-args>) ? 1 : 0 + <q-args>)
+" :display: :[count]VikiTasksDueInMonths [MONTHS=1]
+" Mark [count] task(s) as due in N months.
+command! -bar -range -nargs=? VikiTasksDueInMonths <line1>,<line2>call vikitasks#ItemsMarkDueInMonths(0, empty(<q-args>) ? 1 : 0 + <q-args>)
+
+
augroup VikiTasks
autocmd!
if has('vim_starting')
Please sign in to comment.
Something went wrong with that request. Please try again.