Open andreiborisov opened 5 years ago
I guess this should be customizable, because some people may want to still see such files in the sidebar, just not indexed (i.e more like index_exclude_patterns
), and others may still want them indexed etc. like how it is now. So I guess somehow it would be a mix of binary_file_patterns
, folder_exclude_patterns
and index_exclude_patterns
, which could make it harder to figure out why some files are not appearing etc. compared to how it is now
I see it as an option or two. For example:
"dont_index_ignored_git_files": true,
"exclude_ignored_git_files": false
I feel like those are defaults that most people probably want. Existent *_patterns
settings would overwrite those, so user can include some of the files ignored by Git.
This was partly addressed in Build 4050.
.gitignore
are not indexed by default. Controlled via index_exclude_gitignore
setting.Just want to add my 2 pennies, I have a use-case where I want to be able to search files specified in .gitignore
but not include them in source, and Sublime doesn't give me a good mechanism for that. I've set index_exclude_gitignore
to false
, and while it did labor quite a bit on indexing those files, I still couldn't see those files in the search results. Entirely possible this is some user error on my part, but this might be tied up in what was meant by it being 'partly' addressed.
I was really surprised to find that enabling index_exclude_gitignore
didn't stop gitignored results from showing up when looking for files with Ctrl+P. I agree that making folder_exclude_patterns
interoperate with .gitignore makes sense and I would argue that this should be the default because it's the most intuitive behavior (as it is in other editors and IDEs). Would it be possible to get this feature implemented any time soon?
@bahoo In ST4 when searching it's possible to toggle the index_exclude_gitignore
from the search UI:
More here: https://forum.sublimetext.com/t/how-to-disable-this-feature/58127
Does that achieve what you're looking for?
Oooh, clutch ! Missed that in the new UI, thank you @keybits !
@jvican Exactly. What's the point of index_exclude_gitignore
if the files are still going to show up in the file lookup?
What's weird is that the files/folders are nevertheless greyed out in the sidebar, so this is especially confusing. Is Sublime ignoring the files, or is it not?
Displaying files and indexing their content are 2 different functions.
ST manages an internal representation of all files (excluding binary_files_patterns
) and folders (excluding folder_exclude_patterns
) in RAM. That's the source for sidebar and Goto Anything (ctrl+p).
Indexing means to open each file (excluding index_exclude_patterns
or index_exclude_gitignore
), look for symbols (class names, functions, ...) and store them in a database. That's what drives "Goto Symbol in Project..." (ctrl+shift+r) or enables ST to provide symbol kind information in auto completions.
.gitignore
d files are greyed out to indicate they are not part of the version history. That's how ST default theme decides to display those files. It could also dispaly a batch on the right as for modified files.
@deathaxe Ah, I see. Could a similar setting to index_exclude_gitignore
be added for the files display? Maybe as folder_exclude_gitignore
or the like?
EDIT: Actually more like goto_exclude_gitignore
, since it seems like folder_exclude_pattern
hides the matching folders from the sidebar as well, which is not what I want.
I have set index_exclude_gitignore: false
, but Find In Files
still refuses to search for files in git ignored directory. What am I doing wrong? Build 4169
.
Problem description
A lot of unnecessary files like dependencies in
node_modules
for Node.js projects and build files are added to Sublime project automatically and indexed.Preferred solution
Now since Sublime became Git aware it would be nice to automatically exclude files from Sublime project based on
.gitignore
rules which are usually already setup for most projects.Alternatives
.gitignore
rules, hasn't been updated in a long time and slowing Sublime Text significantly.Additional Information
Since
folder_exclude_patterns
setting does essentially the same thing as.gitignore
I feel like making them to interoperate is a logical step.