I have the following line in my vimrc to enable Javascript completion:
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
The problem is that if I'm working on a JS file that contains a lot of comments, for example:
// draws the map and the pieces depending on the state of the game
Vim picks words from those comments, such as draws
, map
, etc.; and considers them as acceptable code suggestions, which they are clearly not. How can I filter them out?
<C-x><C-o>
it should also say Omni completion in the bottom left)? When I test this my vim doesn't select words from comments. keyword completion on the other hand does select words from comments.