Skip to content

Instantly share code, notes, and snippets.

@scheakur
Created June 18, 2014 14:09
Show Gist options
  • Save scheakur/56fb1aa81f12c1333cf0 to your computer and use it in GitHub Desktop.
Save scheakur/56fb1aa81f12c1333cf0 to your computer and use it in GitHub Desktop.
function! s:complete_log(findstart, base)
if a:findstart == 1
return col('.')
endif
let cmd = '\git log --pretty=format:%s --author=`\git config user.name` -30'
return split(system(cmd), '\n')
endfunction
function! s:fname(name)
let sid = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_fname$')
return printf('<SNR>%s_%s', sid, a:name)
endfunction
execute 'setlocal omnifunc=' . s:fname('complete_log')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment