问题描述
Vim具有此很棒的插件,可以转换当前项目的转换成Vim可以理解的语法,然后从那里排除所有这些文件.
使用Sublime Text 3的执行任何操作"(CMD + P),可以获得很多我不感兴趣的文件,例如.build
和.meteor
下的内容.
ST3是否有类似的东西?
我创建了一个快捷实用的插件, sublime-gitignorer 来解决这个问题.
它目前已在Ubuntu和Windows的Sublime Text 2和3中进行了测试.我希望它也可以在任何其他Linux发行版或Mac上使用.
要安装,假设您具有程序包控制,只需:
- 按 + + ( + + P )
- 选择安装软件包"
- 搜索 Gitignored File Excluder ,然后按.
或者,如果您没有程序包控制,则可以复制 gitignore_plugin.py 到Packages目录,您可以通过从Sublime的 Preferences
菜单中选择 Browse Packages...
来找到该目录.不过,您应该真正获得Package Control,这很有用.
当我说这个插件很脏时,我不是在开玩笑.它的工作方式是每五秒钟插入一次插件:
- 检查打开的文件夹中的Git存储库
- 询问Git在每个存储库中忽略了什么路径
- 将这些路径添加到
file_exclude_patterns
和folder_exclude_patterns
设置.
不过,对于大多数用户来说似乎工作正常-至少只要您在Sublime中打开的文件夹不太大即可.与该插件结合使用,巨型文件夹(例如,典型的node_modules
文件夹)的存在会减慢Sublime的爬网速度.
任何想贡献或报告错误的人都应该查看问题页面. >
Vim has this great plugin to convert the current project's .gitignore
into a syntax understandable by Vim and from there exclude all those files from opening.
Using Sublime Text 3's 'Go to Anything' (CMD+P), I get lots of files I'm not interested in, such as stuff under .build
and .meteor
.
Is there something similar for ST3?
I created a quick-and-dirty plugin, sublime-gitignorer, to solve exactly this problem.
It is currently tested on Ubuntu and Windows in Sublime Text 2 and 3. I expect it will also work on any other Linux distro or on Mac.
To install, assuming you have package control, just:
- Press ++ (++ on Mac)
- Select "Install Package"
- Search for the Gitignored File Excluder and press .
Alternatively, if you don't have package control you can copy gitignore_plugin.py to your Packages directory, which you can locate by selecting Browse Packages...
from the Preferences
menu in Sublime. You should really get Package Control instead, though - it's useful.
I'm not kidding when I say this plugin is dirty. The way it works is that the plugin, every five seconds:
- Checks for Git repos located within your open folders
- Asks Git what paths are ignored in each of those repos
- Adds those paths to the
file_exclude_patterns
andfolder_exclude_patterns
settings.
Seems to work okay for most users, though - at least as long as the folders you're opening in Sublime aren't too huge. The presence of giant folders (e.g a typical node_modules
folder) can, in combination with this plugin, slow Sublime to a crawl.
Anyone looking to contribute or report bugs should check out the issues page.
这篇关于告诉Sublime Text忽略.gitignore中的所有内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!