3

in the case of javascript syntax highlighting, I just had to download javascript.vim file and place the file in the corresponding folder, and vim would automatically make syntax highlighting when I open .js files.

But how does node.vim work?? Where should I place the node.vim file for vim to understand that I am working on node applications and apply the node syntax highlighting??

Thanks in advance....

3
  • Node is JavaScript. Why would it have different syntax highlighting? Commented Jul 25, 2014 at 12:30
  • for example,.. keywords like require, http, etc.. they are not highlighted using the javascript.vim file only, I thought it would need some additional help from node.vim or other equivalent files Commented Jul 25, 2014 at 14:47
  • Those are not keywords, they are variables: require contains a function, and http just an object. There is no difference between require and http on one hand and, say, numberOfFlags or x on the other. It makes little sense to colour them differently when you can just make new "keywords" simply by installing more packages. Real keywords are a fixed inventory, that can't be redefined or used as identifiers, like continue, function or in. Commented Jul 25, 2014 at 16:13

2 Answers 2

4

Node.vim has a few ways to install it listed in its README. Did you have trouble with them?

I personally use and suggest Pathogen together with Git. In Node.vim's case installing it would be only:

git clone https://github.com/moll/vim-node.git ~/.vim/bundle/node

Pathogen would then find Node.vim on next startup and initialize it.

Sign up to request clarification or add additional context in comments.

Comments

0
  1. Some third party plugins may enhance the defaults but Javascript is supported natively so you don't need to download anything for Vim to detect and highlight .js files.

  2. What node.vim file are you talking about? Does it come from that plugin?

1 Comment

YES. I have been searching for plugins for node.js and that was one of them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.