• sublime text 3 安装Nodejs插件


    如题

    1)集成Nodejs插件到sublime,地址:https://github.com/tanepiper/SublimeText-Nodejs
    2)解压zip文件, 并重命名文件夹“Nodejs”
    3)打开sublime的插件文件夹,操作"preference(首选项)" --> "Browse packages(浏览插件)",或者sublime安装目录下的DataPackages
    4)“Nodejs”复制到插件文件夹
    5)打开Nodejs文件夹,更改配置文件。打开文件“Nodejs.sublime-build”

    { 
       "cmd": ["node", "$file"], 
       "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)", 
       "selector": "source.js", 
       "shell":true, 
       "encoding": "cp1252", 
       "windows": 
        { 
          "cmd": ["taskkill /F /IM node.exe & node", "$file"] 
        }, 
       "linux": 
        { 
          "cmd": ["killall node; node", "$file"] 
        } 
    }
    

    把cp1252修改为GB2312或者utf8,防止build nodejs代码时终端显示乱码 ,修改如下

    { 
       "cmd": ["node", "$file"], 
       "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)", 
       "selector": "source.js", 
       "shell":true, 
       "encoding": "utf8", 
       "windows": 
        { 
          "cmd": ["taskkill /F /IM node.exe & node", "$file"] 
        }, 
       "linux": 
        { 
          "cmd": ["killall node; node", "$file"] 
        } 
    }

    6)再打开文件“Nodejs.sublime-settings”,或者设置“preference(首选项)”-->“package settings(插件设置)”-->Nodejs”-->“setting-default”

    {
    // save before running commands
    "save_first": true,
    // if present, use this command instead of plain "node"
    // e.g. "/usr/bin/node" or "C:in
    ode.exe"
    "node_command": false,
    // Same for NPM command
    "npm_command": false,
    // as 'NODE_PATH' environment variable for node runtime
    "node_path": false,
    
    "expert_mode": false,
    
    "ouput_to_new_tab": false
    }
    

    修改如下

    {
      // save before running commands
      "save_first": true,
      // if present, use this command instead of plain "node"
      // e.g. "/usr/bin/node" or "C:in
    ode.exe"
      "node_command": /usr/bin/nodejs,
      // Same for NPM command
      "npm_command": /usr/bin/npm,
      // as 'NODE_PATH' environment variable for node runtime
      "node_path": false,
    
      "expert_mode": false,
    
      "ouput_to_new_tab": false
    }
    

      

    学习,以记之。如有错漏,欢迎指正

    作者:冯子武
    出处:http://www.cnblogs.com/Zev_Fung/
    本文版权归作者和博客园所有,欢迎转载,转载请标明出处。
    如果博文对您有所收获,请点击下方的 [推荐],谢谢

  • 相关阅读:
    Hessian简要入门
    MapReduce启动的Map/Reduce子任务简要分析
    hive默认分隔符引起的日志分割问题
    Spring MVC中发布Restful Web服务
    JPA基本介绍以及使用
    hsqldb简单使用总结
    Vim编辑器基本操作学习(二)
    locale错误导致Java中文乱码错误的总结
    Vim编辑器基本操作学习(一)
    hadoop map任务Combiner被调用的源码逻辑简要分析
  • 原文地址:https://www.cnblogs.com/Zev_Fung/p/6408793.html
Copyright © 2020-2023  润新知