Skip to content

Instantly share code, notes, and snippets.

@mizchi
Created November 24, 2010 08:09
Show Gist options
  • Select an option

  • Save mizchi/713310 to your computer and use it in GitHub Desktop.

Select an option

Save mizchi/713310 to your computer and use it in GitHub Desktop.
howmのタイトル一覧を取得
#howmを使っているならhowm_dirが定義されているはず
let howm_dir="~/Dropbox/memo"
let s:unite_howm = {
\ 'name': 'howm',
\ 'howm_dir': howm_dir,
\ }
function! s:unite_howm.gather_candidates(args, context)
let lines = split(system("grep ^= " . s:unite_howm.howm_dir . "/*/*/*" ), "\n")
" let lines = split(system("grep ^= " . "~/Dropbox/memo/*/*/*" ), "\n")
" let lines = split(system(printf("%s%s%s", "grep ^= " , howm_dir , "\/*/*/*") ), "\n")
let path = expand('#:p')
let format = '%' . strlen(len(lines)) . 'd: %s`'
return map(lines, '{
\ "word": split(v:val, ":")[1] ,
\ "source": "howm",
\ "kind": "jump_list",
\ "action__path": split(v:val, ":")[0],
\ }')
endfunction
call unite#define_source(s:unite_howm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment