[Haskell-cafe] Generating tagfiles for Vim

Evan Laforge qdunkan at gmail.com
Tue Apr 2 05:06:14 UTC 2019


On Mon, Apr 1, 2019 at 8:56 AM Nathan Merkley <nathanmerkley at gmail.com> wrote:
>
> While there is probably a better way, my limited knowledge of vimscript had me write this and it works well enough
>
> function! UpdateHaskellTags()
>     if filereadable("tags")
>         execute "silent !grep -v '" . bufname("%") . "' ./tags > __newtags"
>         execute "silent !rm tags"
>         execute "silent !mv __newtags tags"
>         execute "silent !fast-tags " . bufname("%")
>     endif
> endfunction
>
> autocmd BufWritePost *.hs :call UpdateHaskellTags()
> autocmd BufWritePost *.hsc :call UpdateHaskellTags()

If I'm reading it right, this goes to a lot of work to defeat (or
reimplement?) the default incremental tagging.  Why not just 'execute
fast-tags %'?

I use a script like "if [[ -r tags ]]; then fast-tags -R; else
fast-tags $1; fi" for that first generate, and put 'rm tags' in the
merge posthook.


More information about the Haskell-Cafe mailing list