<div dir="ltr"><div dir="ltr">While there is probably a better way, my limited knowledge of vimscript had me write this and it works well enough<div><br></div><div><br></div><div><div>function! UpdateHaskellTags()</div><div>    if filereadable("tags")</div><div>        execute "silent !grep -v '" . bufname("%") . "' ./tags > __newtags"</div><div>        execute "silent !rm tags"</div><div>        execute "silent !mv __newtags tags"</div><div>        execute "silent !fast-tags " . bufname("%")</div><div>    endif</div><div>endfunction</div><div><br></div><div>autocmd BufWritePost *.hs :call UpdateHaskellTags()</div><div>autocmd BufWritePost *.hsc :call UpdateHaskellTags()</div></div><div><br></div><div><br></div></div><div>This uses fast-tags to regenerate tags for the current file on every save, but will only work if you are operating from the root of your project (or wherever you keep your tags). I use ctrlp for navigation so that's never been a problem for me</div><div><br></div><div>Nathan Merkley</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 1, 2019 at 9:26 AM Vanessa McHale <<a href="mailto:vanessa.mchale@iohk.io">vanessa.mchale@iohk.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
I had been using hasktags for tag generation previously, however, I<br>
recently discovered that using GHCi with<br>
<br>
cabal new-repl<br>
λ:> :ctags<br>
<br>
creates a tags file that actually works with preprocessors (e.g. c2hs or<br>
alex or happy).<br>
<br>
Is there any way to run this semi-automatically?<br>
<br>
echo ':ctags' | cabal new-repl<br>
<br>
seems to work in the shell, but I'd like a vim integration if possible<br>
(also, it's slow).<br>
<br>
Cheers,<br>
Vanessa McHale<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>