Nodejs ctrl+b shortcut key settings

Source: Internet
Author: User

When developing Nodejs, use sublime software, which has a lot of startup methods. can also use Supersivor of course can take advantage of Nodejs's own function through ctrl+b to start directly.

How to set it up:

1) Download sublime and install, download list: http://www.jb51.net/softs/132432.html

2) Download Sublime Nodejs plug-in, need to be integrated Nodejs plug-in to sublime,: Https://github.com/tanepiper/SublimeText-Nodejs

3) Unzip the zip file and rename the folder "Nodejs"

4) Open Sublime, operation "preference"-"Browse packages", open a directory, this directory is the location of many language IDE plug-ins.

5) Copy the "Nodejs" folder to this directory. Is that OK? The sauce does not work, and you need to change the configuration file.

6) Then set the basic settings for the Nodejs plugin:

Preferences--Plug-in Settings--nodejs--Setting-default

Modify the following settings, that is, modify the Node_command and Npm_command for your own computer corresponding to the path

{  //save before running commands  "Save_first":true,  //if present, use the This command instead of plain "node"//e.g. "/usr/bin/node" or "C:\bin\node.exe"  "Node_command":"C:\\Program Files\\nodejs\\node.exe",  //same for NPM command  "Npm_command":"C:\\Program Files\\nodejs\\npm.cmd",  //As ' node_path ' environment variable for NODE runtime  "Node_path":false,  "Expert_mode":false,  "Ouput_to_new_tab":false}

8) Then: Preferences--Browse plugins,

Locate the configuration file Nodejs.sublime-build under the Nodejs plugin.

The most important of these is the following sentence:

"cmd": ["taskkill/f/im Node.exe & Node", "$file"]

The idea is to kill the current process before starting a new thread. Otherwise it will newspapers the mouth is occupied error.
1 {2   "cmd": ["node","$file"],3   "File_regex":"^[]*file \ "(... *?) \ ", line ([0-9]*)",4   "selector":"Source.js",5   "Shell":true,6   "encoding":"UTF-8",7   "Windows":8     {9         "cmd": ["taskkill/f/im node.exe & Node","$file"]Ten     }, One   "Linux": A     { -         "cmd": ["killall node; node","$file"] -     }, the     "OSX": -     { -     "cmd": ["killall node, node $file"] -     } +}

At this point, you can safely use Ctrl+b to run your Nodejs program.

Nodejs ctrl+b shortcut key settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.