Ctrl + M使用Sublime + Linux运行Makefile [英] Ctrl+M to run Makefile with Sublime+Linux
问题描述
我目前正在考虑从Pluma(以前的gEdit)切换到Sublime Text.到目前为止,我在Sublime Text上看到的效果都很好.
我当前正在测试Submlime Text 2,并且希望它在我按 Ctrl + M 时当前打开的文档文件夹中执行make
. /p>
有可能吗?我该怎么办?
当我当前按下 Ctrl + M 时,它确实会构建我当前查看的LaTeX文档,但是它不使用我的Makefile
.这很糟糕,因为它无法构建我的主文档,而这个主文档的构建过程更加复杂.
设置Tools > Build System > Make
后,它将运行make,但不运行当前文档文件夹的Makefile.
我发现了此,但它似乎专注于OS X.
这个答案几乎是我所需要的:
执行以下步骤,使Sublime Text 2(ST2)在Linux下按 Ctrl + m 时执行make
(在我的情况下:Linux Mint,基于Debian的发行版):
- 使用
which make
获取 - 转到您的ST2用户配置目录
/home/[Your user name]/.config/sublime-text-2/Packages/User
- 插入一个名为
Make (Linux).sublime-build
的文件,其内容如下. - 在ST2中选择
Tools > Build System > Make (Linux)
make
的路径
您可能会注意到ST2的路径与Shell中的路径不同.参见崇高文字2:自定义PATH和PYTHONPATH .
制作(Linux).sublime-build
您可能必须根据需要调整path
.我只是将echo $PATH
的内容放在此字段中(这比下面的简单示例要多得多).
{
"cmd": ["make"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path:${folder:${file_path}}}",
"selector": "source.makefile",
"path": "/usr/bin/:/usr/local/texlive/2013/bin/i386-linux",
"variants":
[
{
"name": "Clean",
"cmd": ["make", "clean"]
},
{
"name": "Test",
"cmd": ["make", "test"]
}
]
}
I'm currently thinking about switching from Pluma (former gEdit) to Sublime Text. What I have seen so far from Sublime Text is pretty nice.
I currently test Submlime Text 2 and would like it to execute make
in the folder of the document that is currently opened when I press Ctrl + M.
Is that possible? How do I do it?
When I currently hit Ctrl + M it does build the LaTeX document I currently view, but it does not use my Makefile
. That is bad, because it fails to build my main document which has a more complicated build process.
After setting Tools > Build System > Make
it runs make, but not the Makefile of the current documents folder.
I've found this, but it seems to focus on OS X.
This answer was almost what I needed:
Do the following steps to make Sublime Text 2 (ST2) execute make
when you hit Ctrl + m under Linux (in my case: Linux Mint, a Debian based distribution):
- Get the path of
make
withwhich make
- Go to your ST2 user config directory
/home/[Your user name]/.config/sublime-text-2/Packages/User
- Insert a file called
Make (Linux).sublime-build
with the content from below. - Choose
Tools > Build System > Make (Linux)
in ST2
You might notice that ST2 has a different PATH than you have in your shell. See Sublime Text 2: custom PATH and PYTHONPATH.
Make (Linux).sublime-build
You might have to adjust path
to your needs. I've simply put the content of echo $PATH
in this field (which is much more than the simple example from below).
{
"cmd": ["make"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path:${folder:${file_path}}}",
"selector": "source.makefile",
"path": "/usr/bin/:/usr/local/texlive/2013/bin/i386-linux",
"variants":
[
{
"name": "Clean",
"cmd": ["make", "clean"]
},
{
"name": "Test",
"cmd": ["make", "test"]
}
]
}
这篇关于Ctrl + M使用Sublime + Linux运行Makefile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!