Skip to content

Instantly share code, notes, and snippets.

@jferris
Created January 6, 2011 19:28
Show Gist options
  • Select an option

  • Save jferris/768419 to your computer and use it in GitHub Desktop.

Select an option

Save jferris/768419 to your computer and use it in GitHub Desktop.
Automatically updates tmp/tags as files are written
function! UpdateCtags()
if filereadable("tmp/tags") && strpart(expand("%"), 0, len(getcwd())) == expand("%")
execute "silent! !ctags -f tmp/tags -a " . expand("%:p")
endif
endfunction
augroup ctags
autocmd!
autocmd BufWritePost * call UpdateCtags()
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment