Tell Sublime Text to ignore everything in .gitignore?

Vim has this great plugin to convert the current .gitignore project into a syntax that Vim understands, and from there exclude all of these files from opening.

Using Sublime Text 3 'Go to Anything' (CMD + P), I get a lot of files that I am not interested in, for example, materials for .build and .meteor .

Is there something similar for ST3?

+44
gitignore sublimetext sublimetext3
Aug 28 '13 at 8:31
source share
3 answers

I created a quick and dirty sublime-gitignorer plugin to solve this problem.

It is currently being tested on Ubuntu and Windows in Sublime Text 2 and 3. I expect it to work on any other Linux distribution or Mac as well.




To install, if you have package control , simply:

  • Press CTRL + SHIFT + P ( CMD + SHIFT + P on Mac)
  • Select Install Package
  • Find Gitignored File Excluder and press Enter .

Alternatively , if you do not have package management, you can copy gitignore_plugin.py to the package directory, which you can find by selecting Browse Packages... from the Preferences menu in Sublime. You really should get Package Control instead, although this is useful.




I'm not joking when I say that this plugin is dirty. The way it works is that the plugin every five seconds:

  • Checks for Git repos located in your open folders
  • asks Git which paths are ignored in each of these repos
  • Adds these paths to the file_exclude_patterns and folder_exclude_patterns .

Everything seems to be working fine.

Anyone who wants to contribute or report bugs should check the page.

+46
Oct. 14 '14 at 23:47
source share

You can get a list of all ignored files with

git ls-files --others -i --exclude-standard

and then add this to your file_exclude_patterns in Sublime Text, as suggested by bheklilr.

+6
Aug 07 '14 at 18:38
source share

Assuming you have Sublime 3 and the package manager is already installed:

  • add repo https://github.com/apc999/sublime-text-gitignore
  • add package sublime-text-gitignore
  • use menu item: File-> Exclude Git -ignored

Good luck :)

+1
Aug 29 '14 at 9:27
source share



All Articles