Question

I use the excellent EasyTags plugin with vim. My only problem with it is that Exuberant CTags does not support Haskell. However, there are several programs which do generate Haskell vim tags files correctly and I already use the per file type tags file option in EasyTags.

Is there a way to tell EasyTags to use different ctags program on a per filetype basis? I could write a wrapper script and set that as the global ctags program but would prefer a cleaner solution.

I've tried

:autocmd FileType haskell let g:easytags_cmd = '~/.cabal/bin/lushtags'

But EasyTags seems to attempt to query the ctags program for a list of supported languages so when I open a Haskell file with this option enabled I get an error.

"Data/Csv/Conduit.hs" [RO] 51L, 1950C
Error detected while processing function xolox#easytags#register..xolox#easytags#get_tagsfi
le..xolox#easytags#supported_filetypes..34_check_filetype:
line    3:
E605: Exception not caught: Failed to get supported languages! (output: Usage: lushtags [op
tions] [--] )
Error detected while processing function xolox#easytags#register..xolox#easytags#get_tagsfi
le..xolox#easytags#supported_filetypes:
line   14:
E171: Missing :endif
Error detected while processing function xolox#easytags#register..xolox#easytags#get_tagsfi

Was it helpful?

Solution

Fellow EasyTags user here, I always wanted that functionality, too (for jsctags). I've implemented a patch that allows to configure separate executables for particular languages.

Until this is merged (unfortunately, there hasn't been any activity there in the past few months), you can use my fork. The configuration would be something like this:

let g:easytags_languages = {
\   'haskell': {
\       'cmd': '~/.cabal/bin/lushtags',
\       'args': [],
\       'fileoutput_opt': '-f',
\       'stdout_opt': '-f-',
\       'recurse_flag': '-R'
\   }
\}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top