Macbook上sublime的C++11弥补bits/stdc++.h的配置
如果在windows配置过的话这次会容易很多。相关博客很多了,我这里保存一下我借鉴并成功的配置:
关于自己build的C++,文件类型为sublime-build,直接扔在它给出的user文件夹即可,不必特意指定:
{
"cmd": ["clang++", "${file}","-std=c++11", "-stdlib=libc++", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "clang++ '${file}' -std=c++11 -stdlib=libc++ -o '${file_path}/${file_base_name}' && open -a Terminal.app '${file_path}/${file_base_name}'"]
}
]
}

然鹅这个在终端运行没有我原来在win10的那个配置方便,不过有command+W快捷键关闭,就这样吧……
然后据说Mac不支持bits/stdc++.h,那么就换一种偷懒的方式……依次进入tools、developer、new snippet,建一个上图的acm.sublime-snippet,我使用的是:
<snippet>
<content><![CDATA[
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <climits>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <random>
#include <string>
#include <sstream>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <fstream>
#define ri readint()
#define gc getchar()
#define R(x) scanf("%d", &x)
#define W(x) printf("%d\n", x)
#define init(a, b) memset(a, b, sizeof(a))
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define irep(i, a, b) for (int i = a; i >= b; i--)
using namespace std; typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
const int inf = 0x3f3f3f3f;
const ll INF = 1e18; ]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>acm</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.c++</scope>
</snippet>
根据自己习惯进行改写。这部分内容的使用方法详见且多谢这位前辈的博客
Macbook上sublime的C++11弥补bits/stdc++.h的配置的更多相关文章
- <bits/stdc++.h>头文件介绍(包含源代码)
注:转自http://blog.csdn.net/charles_dong2/article/details/56909347,同为本人写的,有部分修改. 之前在一个小OJ上刷题时发现有人是这么写的: ...
- 2.头文件<bits/stdc++.h>
用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件: #inclu ...
- 为VisualStudio2017添加bits/stdc++.h
在算法编程中经常有人只写一个头文件"bits/stdc++.h" 其实这个是很多头文件的集合,写了它后相当于包含了所有常用的C++头文件,可是需要注意的是并不是所有的OJ系统都支持 ...
- 6-关于#include<bits/stdc++.h>
万能头文件#include<bits/stdc++.h> (转载) 最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h& ...
- 关于#include <bits/stdc++.h>
经常看人写#include <bits/stdc++.h>却不知道是干啥的? #include<bits/stdc++.h>包含了目前c++所包含的所有头文件 对比: #inc ...
- C++ 中头文件<bits/stdc++.h>的优缺点
在编程竞赛中,我们常见一个头文件: #include <bits/stdc++.h> 发现它是部分C++中支持的一个几乎万能的头文件,包含所有的可用到的C++库函数,如<istrea ...
- VS2022不能使用<bits/stdc++.h>的解决方案
•<bits/stdc++.h>介绍 #include<bits/stdc++.h> 包含了目前 C++ 所包含的所有头文件,又称万能头文件,简直是开挂一般的存在. 你编程 ...
- 高级c++头文件bits/stdc++.h
用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件: #includ ...
- C++头文件#include<bits/stdc++.h>
一句话的事,直截了当——#include<bits/stdc++.h>包含C++的所有头文件 参考网站(点击):http://www.tuicool.com/articles/m6neUj ...
随机推荐
- # <center>merge表不可用的问题</center>
最近碰到了个很有意思的问题,值得一写 给merge表和基础表添加索引时发生了一个问题,不管是先给merge表加索引还是基础表加索引,如果表数据量大都会导致加索引期间对merge表的查询不可用,因为使用 ...
- linux应用之apache服务的安装及配置(centos)
CentOS Apache服务器安装与配置 一.安装Apache程序,一般有三种安装方式:1.直接网络安装:2.下载rpm包,上传至服务器进行安装:3.通过原代码编译安装: yum -y inst ...
- margin-top 为什么会影响父元素的 margin-top
1.原因: In this specification, the expression collapsing margins means that adjoining margins (no non ...
- 配置ADT
配置ADT环境变量打开PATH,添加变量值:F:\android-sdk-windows\tools
- jmeter解压后启动jmeter.bat报错:Not able to find java executable or version
错误详情: 错误解决方法: 修改环境变量配置将%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;移动到%SystemRoot%\system32;%SystemRoot%;%Sy ...
- MAC 安装phantomjs
step1:下载压缩包http://phantomjs.org/ step2:解压缩,我是解压缩到/Users/gxy/software step3:写入配置路径,vi ~/.bash_profile ...
- rsync(六)命令中文手册
rsync(1) rsync(1) 名称 rsync - 一个快速.多功能的远程(和本地)文件拷贝工具 摘要 Local: rsync [OPTION...] SRC... [DEST] Access ...
- haproxy小结(一)基础概念篇
HAProxy是法国人Willy Tarreau个人开发的一个开源软件,目标是应对客户端10000以上的同时连接,为后端应用服务器.数据库服务器提供高性能的负载均衡服务.HAproxy可以实现基于TC ...
- 创建cube 维度层次
http://blog.programmingsolution.net/ssas-2008/period-dimension-time-dimension-creation-with-year-mon ...
- SQL repeat()函数
转自:https://www.yiibai.com/sql/sql-repeat-function.html REPEAT(str,count) 返回一个字符串组成的字符串STR重复的次数.如果计数小 ...