• sublime2 c++的一些使用配置


    1

    下载安装好tdw gcc后,配置好环境变量后,配置sublime2.
    tools->build system-> new build system...

    里面输入:

    {
        "cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}","-std=c++11"],
        "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
        "working_dir": "${file_path}",
        "selector": "source.c, source.c++",
        "shell": true,
        "variants":
        [
            {
                "name": "Run",
                "cmd": ["cmd", "/c", "g++ -std=c++11", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "cmd", "/c", "${file_path}/${file_base_name}"]
            },
            {
                "name": "RunInCommand",
                "cmd": ["cmd", "/c", "g++ -std=c++11", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & pause"]
            }
        ]
    }
    

    ctrl+B 编译 , ctrl+shift+B,编译运行。

    2

    目录D:Program Files (x86)Sublime Text 2DataPackagesC++下有些.sublime-snippet文件,
    这些文件是语句块补全,可以使得在写代码过程中加快速度,例如输入inc,可补全为#include<.h>,等等
    修改这些文件,使得自动补全的代码块更加符合自己的习惯。

  • 相关阅读:
    28
    27
    26
    25
    24
    23
    17
    16
    15
    14
  • 原文地址:https://www.cnblogs.com/iois/p/4935708.html
Copyright © 2020-2023  润新知