如何排除SublimeText3中没有扩展名的文件?

问题描述 投票:0回答:1

我知道对已知扩展名有一个简单的处理方法,可以将其添加到排除模式中,例如“ * .jpg”,但对于没有扩展名的二进制文件,我该怎么办呢?

例如,我的c编译文件仅用“名称”命名,而不用“ name.o”等命名,所以有什么技巧可以将它们排除在外?

sublimetext3
1个回答
0
投票
例如,如果您创建一个名为run_example的可执行文件,如下所示:

gcc example.c -o run_example

然后排除它,将run_example像这样添加到file_exclude_patterns列表中:

"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", ..., "run_example"],

为了避免必须定期执行此操作,您可以执行以下两项操作之一或执行两项操作。

1)始终使用相同的可执行文件名,例如run,无论您要编译什么。

gcc example.c -o run "file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", ..., "run"],

2)为可执行文件选择文件扩展名,并始终使用它。

gcc example.c -o example.out

"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", ..., "*.out"],
© www.soinside.com 2019 - 2024. All rights reserved.