Created
May 8, 2009 04:39
-
-
Save soh335/108622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"{{{ taskpaper.vim | |
map <silent><space>td <Plug>ToggleDone | |
function! s:OpenTaskPaper() | |
let g:Taskpaper_default_path = '/path/to/file' | |
execute 'e '.g:Taskpaper_default_path | |
setlocal noswapfile | |
setlocal nonumber | |
noremap <buffer> <silent> q :close<Cr> | |
endfunction | |
nnoremap <silent><space>ts :<C-u>split \| call <SID>OpenTaskPaper()<Cr> | |
nnoremap <silent><space>tv :<C-u>vsplit \| call <SID>OpenTaskPaper()<Cr> | |
"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"taskpaper.vim indent file | |
"soh kitahara | |
if exists('b:did_indent') | |
finish | |
endif | |
let b:did_indent = 1 | |
setlocal indentexpr=GetTaskpaperIndent() | |
setlocal indentkeys+=<:> | |
function! GetTaskpaperIndent() | |
let pnum = prevnonblank(v:lnum - 1) | |
if pnum == 0 | |
return 0 | |
endif | |
let line = getline(v:lnum) | |
let pline = getline(pnum) | |
let ind = indent(pnum) | |
let project = '^.\+:\s*$' | |
let item = '^\s*[-+]\s\+' | |
if pline =~ project && pline !~ item | |
let ind = ind + &sw | |
elseif line =~ project && line !~ item | |
let ind = ind - &sw | |
endif | |
return ind | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment