How to configure tern-vim in my project?

I want to install tern-vim in my project and follow this link https://github.com/ternjs/tern_for_vim/blob/master/doc/tern.txt . After installation, I created a .tern-project file in the root directory of my project, as shown below.

{
      "libs": [
        "browser",
        "jquery"
      ],
      "loadEagerly": [
        "importantfile.js"
      ],
      "plugins": {
        "requirejs": {
          "baseURL": "./",
          "paths": {}
        }
      }
    }

When I open the js file with the vim command, I cannot use the tern command as shown below:

|:TernDoc|...................... Look up Documentation
    |:TernDocBrowse|................ Browse the Documentation
    |:TernType|..................... Perform a type look up
    |:TernDef|...................... Look up definition
    |:TernDefPreview|............... Look up definition in preview
    |:TernDefSplit|................. Look up definition in new split
    |:TernDefTab|................... Look up definition in new tab
    |:TernRefs|..................... Look up references
    |:TernRename|................... Rename identifier

I will get an error Not an editor command. Do I need to do any other configuration?

+4
source share

Source: https://habr.com/ru/post/1666210/


All Articles