How to auto-complete JavaScript syntax in Vim
JavaScript is the scripting language for the web. Vim in the other hand is the editor of choice for many programmers. Being feature-rich, Vim is able to auto-complete JavaScript syntaxes. To use the feature, you’ll need to enable it first.
Enter the following while in Vim’s command mode to enable the feature.
:set omnifunc=javascriptcomplete#CompleteJS
You can now auto-complete JavaScript syntaxes by pressing Ctrl + x
followed by Ctrl + o
while partially typing JavaScript codes.
The following is a sample screenshot.
You can use the arrow key to navigate through the list to choose your desired auto-complete suggestion.