" NVIM_LISTEN_ADDRESS=127.0.0.1:6666 function! TW_done() range call Nvimx_notify( 'tw_done', getline( a:firstline, a:lastline ) ) endfunction function! TW_delete() range call rpcrequest( g:nvimx_channel, 'tw_delete', getline( a:firstline, a:lastline ) ) endfunction function! TW_show(...) if a:0 call rpcrequest( g:nvimx_channel, 'tw_show', a:1 ) else let filter = input( "filter: ", "" ) call rpcrequest( g:nvimx_channel, 'tw_show', filter ) endif endfunction function! TW_toggle_focus() call rpcrequest( g:nvimx_channel, 'tw_toggle_focus' ) endfunction function! TW_info() range call rpcrequest( g:nvimx_channel, 'tw_info', getline( a:firstline, a:lastline ) ) endfunction function! TW_mod(...) range if a:0 call rpcrequest( g:nvimx_channel, 'tw_mod', a:1, a:firstline, a:lastline, getline( a:firstline, a:lastline ) ) else let filter = input( "mod: ", " " ) call rpcrequest( g:nvimx_channel, 'tw_mod', filter, a:firstline, a:lastline, getline( a:firstline, a:lastline ) ) endif endfunction function! TW_append(...) range if a:0 call rpcrequest( g:nvimx_channel, 'tw_append', a:1, a:firstline, a:lastline, getline( a:firstline, a:lastline ) ) else let filter = input( "mod: ", " " ) call rpcrequest( g:nvimx_channel, 'tw_append', filter, a:firstline, a:lastline, getline( a:firstline, a:lastline ) ) endif endfunction function! TW_wait(...) range if a:0 call rpcrequest( g:nvimx_channel, 'tw_mod', a:1, a:firstline, a:lastline, getline( a:firstline, a:lastline ) ) else let filter = input( "wait: ", "eow" ) call rpcrequest( g:nvimx_channel, 'tw_wait', filter, a:firstline, a:lastline, getline( a:firstline, a:lastline ) ) endif endfunction au FileType task map d :call TW_done() au FileType task vmap d :call TW_done() au FileType task map D :call TW_delete() au FileType task vmap D :call TW_delete() au FileType task map ll :call TW_show(' ') au FileType task map lf :call TW_show('+focus') au FileType task map lq :call TW_show() au FileType task map m :call TW_mod() au FileType task vmap m :call TW_mod() au FileType task map a :call TW_append() au FileType task vmap a :call TW_append() au FileType task map f :call TW_toggle_focus() " info au FileType task map i :call TW_info() au FileType task vmap i :call TW_info() " priority au FileType task map pl :call TW_mod('priority:L') au FileType task map pm :call TW_mod('priority:M') au FileType task map ph :call TW_mod('priority:H') au FileType task vmap pl :call TW_mod('priority:L') au FileType task vmap pm :call TW_mod('priority:M') au FileType task vmap pm :call TW_mod('priority:M') " wait au FileType task map W :call TW_wait() au FileType task vmap W :call TW_wait() au FileType task set nowrap au FileType task TableModeEnable map tS :TableSort! function! Task() call Nvimx_load_plugin('Taskwarrior') endfunction