zoukankan      html  css  js  c++  java
  • sublime搭建c++/java/lua/python/ruby的配置文件

    本人电脑win7 64位

    提前装一下convert to utf-8插件,编译运行出现乱码,组合键ctrl+shift+c把源文件转成gbk编码. 仍乱码的话,重启编辑器|电脑|重新编辑中文部分。

    c++

    {
    "working_dir": "$file_path",
    "cmd": "g++ -Wall -fexec-charset=GBK "$file_name" -o "$file_base_name"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "selector": "source.c",

    "variants":
    [
    {
    "name": "Run",
    "shell_cmd": "g++ -Wall -fexec-charset=GBK "$file" -o "$file_base_name" && start cmd /c ""${file_path}/${file_base_name}" & pause""
    }
    ]
    }

    java

    {
        "cmd": ["cmd","/c","javac -encoding gbk -d . ${file}"],
        "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
        "selector": "source.java",
        "encoding":"gbk",
        "variants": [{
            "name": "Run",
            "shell": true,
            "encoding":"gbk",
            "cmd": ["start", "cmd", "/c", "java ${file_base_name} & pause"],
            "working_dir": "${file_path}",
        }]
    }

    lua

    {
        "cmd": ["cmd","/c","start","cmd","/c","lua ${file} & pause"],
        "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
        "working_dir": "${file_path}",
        "selector": "source.lua",
    }

    php

    {
        "cmd": ["cmd","/c","start","cmd","/c", "C:/wamp/bin/php/php5.5.12/php.exe $file & pause"],
        "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
        "selector": "source.php",
        "encoding":"gbk"
    }

    python

    {
        "cmd": ["cmd","/c","start","cmd","/c","python ${file} & pause"],
        "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
        "working_dir": "${file_path}",
        "selector": "source.py",
    }

    ruby

    {
        "cmd": ["cmd","/c","start","cmd","/c","ruby ${file} & pause"],
        "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
        "working_dir": "${file_path}",
        "selector": "source.rb",
    }
  • 相关阅读:
    HackerRank
    HackerRank
    LeetCode "Kth Smallest Element in a BST"
    HackerRank
    HackerRank
    LeetCode "Roman to Integer"
    LeetCode "Integer to Roman"
    LeetCode "Majority Element II"
    HackerRank
    HackerRank
  • 原文地址:https://www.cnblogs.com/startnow/p/5045008.html
Copyright © 2011-2022 走看看