5

I was using Syntastic till install YouCompleteMe in terminal vim. So, the thing is that YouCompleteMe doesn't let Syntastic check for errors, but I need both plugins.

YouCompleteMe has some error checkers, but I didn't find a way to make it work to lint Javascript errors.

How can I fix it?

.vimrc for Syntastic

let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 2
let g:syntastic_loc_list_height = 8
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_aggregate_errors = 1
let g:syntastic_id_checkers = 1
let g:syntastic_error_symbol = "✗"
let g:syntastic_warning_symbol = "⚠"

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_javascript_checkers = ['jslint', 'jsonlint', 'gjslint']
let g:syntastic_html_tidy_exec = 'tidy5'

.vimrc for YCM:

" YouCompleteMe and UltiSnips compatibility, with the helper of supertab
let g:ycm_key_list_select_completion   = ['<A-¶>', '<A-Space>', '<Down>']
let g:ycm_key_list_previous_completion = ['<A-§>', '<A-π>', '<Up>']

" You Complete Me Options
let g:ycm_show_diagnostics_ui = 0
let g:ycm_enable_diagnostic_highlighting = 0
let g:ycm_enable_diagnostic_signs = 0
let g:ycm_show_diagnostics_ui = 0
let g:ycm_open_loclist_on_ycm_diags = 0
let g:ycm_complete_in_comments = 0
let g:ycm_complete_in_strings = 0
let g:ycm_collect_identifiers_from_comments_and_strings = 0
let g:ycm_collect_identifiers_from_tags_files = 1

:SyntasticInfo output

> Syntastic version: 3.7.0-31 (Vim 704, Darwin) 
> Info for filetype: javascript
> Global mode: active 
> Filetype javascript is active 
> The current file will be checked automatically 
> Available checkers: -
> Currently enabled checkers: -

I don't know why available and enable checkers has gone? They were there and were working before YCM intallation!

Stevens Garcia
  • 147
  • 2
  • 10
  • 1
    YCM disables syntastic's checkers for C, C++, Objective-C, and Objective-C++ files (and there's an option to turn off that behaviour). For everything else YCM only does code completion, not checking, and can coexist peacefully with syntastic. As for enabling JavaScript linters in syntastic, have you considered reading the manual? Dreadful perspective, I know. – lcd047 Nov 15 '15 at 18:04
  • @lcd047 I read the documentation but actually didn't find the "turn off" option. I added some **let** variables to disable YCM options regarless displaying errors, but Syntastic still not working. I also read Syntastic documentation but everything is ok. I noted that using ``:SyntasticInfo``it is not recognizing the checkers. Look the output above, I'm going to update the question. – Stevens Garcia Nov 15 '15 at 23:34
  • This is not a good place to debug syntastic. The issue tracker is [this way](https://github.com/scrooloose/syntastic/issues). – lcd047 Nov 16 '15 at 08:03

1 Answers1

0

What you could do is use Neovim instead of Vim together with the ALE plugin and optionally the LanguageClient-neovim plugin.

For the latter to work, you will need to run npm install -g javascript-typescript-langserver as well.

This gets you asynchronous linting (ALE) and asynchronous completions/linting features through the JavaScript language server.

herrbischoff
  • 3,294
  • 1
  • 29
  • 50