告诉Sublime Text忽略.gitignore中的所有内容? [英] Tell Sublime Text to ignore everything in .gitignore?

查看:107
本文介绍了告诉Sublime Text忽略.gitignore中的所有内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Vim具有此很棒的插件,可以转换当前项目的转换成Vim可以理解的语法,然后从那里排除所有这些文件.

使用Sublime Text 3的执行任何操作"(CMD + P),可以获得很多我不感兴趣的文件,例如.build.meteor下的内容.

ST3是否有类似的东西?

解决方案

我创建了一个快捷实用的插件,程序包控制,只需:

  • CTRL + SHIFT + P ( CMD + SHIFT + <在Mac上为kbd> P )
  • 选择安装软件包"
  • 搜索 Gitignored File Excluder ,然后按 Enter .

或者,如果您没有程序包控制,则可以复制 gitignore_plugin.py 到Packages目录,您可以通过从Sublime的 Preferences 菜单中选择 Browse Packages... 来找到该目录.不过,您应该真正获得Package Control,这很有用.


当我说这个插件很脏时,我不是在开玩笑.它的工作方式是每五秒钟插入一次插件:

  • 检查打开的文件夹中的Git存储库
  • 询问Git在每个存储库中忽略了什么路径
  • 将这些路径添加到file_exclude_patternsfolder_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 CTRL+SHIFT+P (CMD+SHIFT+P on Mac)
  • Select "Install Package"
  • Search for the Gitignored File Excluder and press Enter.

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 and folder_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中的所有内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆