- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在 macOS 上使用 SublimeText-3 进行 C++ 编程,试图利用构建功能。
在这种情况下,我希望(仅)通过执行 Cmd+B 来构建我的程序。 Cmd+Shift+B 将运行它。
但是当我按下 Cmd+B 时,构建和运行都发生了。
C++ Single File.sublime-build
的内容如下:
{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -std=c++14 \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}
]
}
有什么奇怪的吗?
如何将构建和运行拆分为不同的命令?
一些引用:Sublime text 3 - compile program and run in terminal
在 Preferences - Key Bindings 我看到:
{ "keys": ["f7"], "command": "build" },
{ "keys": ["super+b"], "command": "build" },
{ "keys": ["super+shift+b"], "command": "build", "args": {"select": true} },
我觉得还可以
最佳答案
您检查过您的按键绑定(bind)了吗?他们可能以某种方式被分配给同一个键。在 Preferences - Key Bindings 中,您应该会看到您的设置。我不是 Mac 用户,但你的 C++ 构建文件看起来不错。键绑定(bind)中的build设置应如下所示:
{ "keys": ["ctrl+b"], "command": "build" },
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"select": true} }
不要忘记将 ctrl 更改为您在 mac 上的任何内容。
关于c++ - SublimeText C++ 防止在生成时运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44217653/
为什么 Atom 不能像 sublime text 这样的软包装代码? 我想要全屏代码,但要软包装。这意味着线的末端和关闭小 map 切割线。 我怎么能在原子中做到这一点? 最佳答案 有一些设置会影响
如果您选择一个文本,您可以同时向所有行添加多个制表符空间。 最佳答案 为此,您必须选择 n代码行并按下键 tab .如果你想 删除制表符空间应选择文本并按 shift+tab . 我在工作中编程,我在
我使用的是 Windows(7 和 XP,64 位和 32 位)。当我右键单击一个文件时,它会在编辑器中打开(有时很方便,但通常很烦人,例如 pdf 等)。 有没有一个选项可以阻止 Sublime T
这个问题在这里已经有了答案: How to change style of matched brackets in Sublime Text 2 / 3? (5 个回答) 5年前关闭。 现在打开和关闭
我创建了一个新的构建系统来运行 GolfScript 程序。定义如下: { "cmd": ["ruby", "D:\\w\\sublime\\golfscript.rb", "$file"]
我在Sublime Text 2中有一个深色主题(IR黑色),但是控制台变成黑色的白色。 有没有办法改变控制台的颜色? 最佳答案 在这里找到答案: http://www.sublimetext.com
当我想要Windows行尾时,我的某些文件/选项卡一定是Unix行尾。我可以去查看>行尾>窗口,但这仅适用于打开的当前文件/选项卡。我不想为每个文件都做(我做了)。但是即使这样做,当我打开其他文件时,
在Sublime Text 3的用户首选项中,我可以设置尾随空格的用户首选项: "trim_trailing_white_space_on_save": true 这对javascript文件非常有用
我最近开始遇到这个问题。 无论我打开什么文档,似乎都无法识别它的文件类型(php,html,blade,js等): 每次我都必须手动更改右下角的文件类型(在这里我已将其更改为php,之后一切正常):
我为SublimeText实现了自动补全插件 import sublime_plugin import sublime tensorflow_functions = ["tf.AggregationM
我有一个大文件,我想删除所有包含 date 字样的行 例如: { date: 10291992 stuff: stuff ... }, { date: 02171995 stuff
有没有一种方法可以让Sublime Text对特定目录树中的文件使用不同的语法提示插件? 例如。默认情况下,我想对.js文件使用默认的Javascript文件类型,但是对于〜/Unity/文件夹下的文
我将以下内容保存到我的用户文件夹中的node-sass.sublime-build中 { "shell_cmd": "node-sass.cmd $file", "selector":
如果我不理解错误,那么sublime可以通过配置file_regex或line_regex从错误输出中捕获文件和行号。 我有这样的错误输出: main.. file:///Users/free
我在编辑器Sublime Text中创建了基于HTML和CSS的简单网页。我错误地将我的index.html扩展了另一个(拖放到错误的文件中)。我没有时间再写页面的全部内容。有可能“看一眼” Subl
我升级了版本 2 > 3,现在它似乎是每个文件/文件夹左侧(以及相应箭头右侧)侧边栏中的图标。 我发现这些图标杂乱无章,有什么办法可以隐藏它们吗? 最佳答案 实现这一目标的一种方法是通过主题。 如果您
Sublime Text 中是否可以通过方法调用来获取 PHP 方法声明? // pressing some keys combination should navigate me // to the
我想并排查看同一文件。如何为单个文件打开两个(或更多)选项卡? 最佳答案 文件|文件中的新 View 将为同一文件打开第二个选项卡。可以将其移动到另一个窗口或选项卡组中。 关于sublimetext
我正在尝试使用正则表达式将大写字母替换为相应的小写字母。所以说 EarTH: 1, MerCury: 0.2408467, venuS: 0.61519726, 变成了 earth: 1,
有没有办法为单个项目创建多个工作区文件?每个工作区都需要一个单独的项目文件似乎是违反直觉的。另外,它会非常清楚地表明,只有一个项目文件被 checkin git,并且所有 .sublime-works
我是一名优秀的程序员,十分优秀!