简体   繁体   English

vim EasyTags,每个文件类型标签命令?

[英]vim EasyTags, per file type tags command?

I use the excellent EasyTags plugin with vim. 我使用优秀的EasyTags插件与vim。 My only problem with it is that Exuberant CTags does not support Haskell. 我唯一的问题是Exuberant CTags不支持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. 但是,有几个程序可以正确生成Haskell vim标记文件,我已经在EasyTags中使用了每个文件类型标记文件选项。

Is there a way to tell EasyTags to use different ctags program on a per filetype basis? 有没有办法告诉EasyTags在每种文件类型的基础上使用不同的ctags程序? I could write a wrapper script and set that as the global ctags program but would prefer a cleaner solution. 我可以编写一个包装脚本并将其设置为全局ctags程序,但更喜欢更清洁的解决方案。

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. 但EasyTags似乎试图在ctags程序中查询支持的语言列表,因此当我打开启用了此选项的Haskell文件时,我收到错误。


"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

Fellow EasyTags user here, I always wanted that functionality, too (for jsctags ). 同样在这里的EasyTags用户,我也一直想要这个功能(对于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'
\   }
\}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM