xolox / vim-easytags

Automated tag file generation and syntax highlighting of tags in Vim
http://peterodding.com/code/vim/easytags/
1.01k stars 109 forks source link

Using easytags with jsctags instead of exuberant ctags #136

Closed jamesla closed 8 years ago

jamesla commented 8 years ago

I'm having a lot of trouble getting easytags to use jsctags instead of ctags. I'm struggling to find any detailed documentation on this so a lot of it has been trial and error.

I have jsctags installed and ctags is not installed.

When I open vim I get the error that exuberent ctags is not installed (obviously intentional) and easytags doesn't seem to load properly as I can't use :UpdateTags.

Is anybody able to point me in the right direction to get easytags and jsctags to play nice? Even if I could just get a single functional .vimrc I could probably figure it out from there.

let g:ycm_collect_identifiers_from_tags_files = 1
set tags=./.vimtags;
let g:easytags_cmd = '/Users/james/.nvm/versions/node/v5.5.0/bin/jsctags'
let g:easytags_file = '~/.vimtags'
let g:easytags_updatetime_warn = 0
let g:easytags_events = ['BufReadPost', 'BufWritePost']

let g:easytags_languages = {
      \   'javascript': {
      \       'cmd': g:easytags_cmd,
      \       'args': [],
      \       'fileoutput_opt': '-f',
      \       'stdout_opt': '-f-',
      \       'recurse_flag': '-R'
      \   }
  \}
xolox commented 8 years ago

First things first:

Now for a more general response that may explain the difficulties you're encountering:

I understand that none of this really helps you to get closer to your goal, but it's all I can do for now. I have about 40 open source projects and vim-easytags has been working fine for me for the past few years (i.e. my use cases have been covered) so it doesn't receive a lot of new development (which is what would help to make alternative tags backends easier to use).

xolox commented 8 years ago

Here's an attempt to provide you with some more productive hints (because despite my lack of time to maintain 40+ projects, ideally I like to make every single user of my projects a happy user - it's just not always possible):

If you persist and succeed to get things working, it might be nice to document the steps you needed. If you're willing to help I would be glad to update the README with any additional information that you've learned while integrating jsctags.

Stratus3D commented 8 years ago

@jamesla did you ever get jsctags working in vim? I'm trying to do the same thing, but with doctorjs.

jamesla commented 8 years ago

No I was keen too but never ended up finding any spare time.

alex-shamshurin commented 7 years ago

I did it work with jsctags by changing some code which generate command line string from config in autoload/xolox/easytags.vim and now it works. Of course It could break some functionality for other libs which depends upon g:easytags_languages options, but for jsctags it works. For person who knows vim lang (I don't) it's very easy to make the complete solution.

let cmdline = [program]
call add(cmdline, xolox#misc#escape#shell("-f | sed '/^$/d' | sort"))

And config is

let g:easytags_languages = {
\   'javascript': {
\     'cmd': 'jsctags',
\       'args': [],
\   }
\}