-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for .gitignore in configuration #218
Comments
I like the idea. But I think it should be a command line option and not the default behavior. Curious what others think about this. And it should not be limited to only .gitignore. For instance, there are still people using CVS, so when this option is enabled it should also use .cvsignore. Other VCS's that work with ignore-files should be supported as well. I have no experience with other VCS's, but I know that Mercurial uses .hgignore. |
i think this is one of the main reasons why people prefer ack and ag over grep. but i'm not sure if it should be gitignore but rather a more generic whitelist |
The basic code to do this seems quite simple. In options.c around line 2680 I added this line to test it.
See
And I am not sure yet what the default behavior should be: enabled or disabled. And there must be an option (-X and/or a long option?) to enable/disable this. Know that ctags has more long options with a "=[yes|no]" extension. I think there is not much wrong with using all the common ignore files. |
Considering that |
The problem is that it doesn't honor things like global .gitignore, etc.
|
AFK right now, but AFAIK .gitignore doesn't support regex but just simple file match patterns. And that is already supported by ctags --exclude. You are right about the global ignore files. Is also solvable by using full path names in the option but I like the ease of a simple switch. |
I don't think ctags should add an option for this. Instead the tools like
In a similar fashion |
I agree with @blueyed but not in the same way. I would love this feature. I don't think however that the list of files needs to be piped into ctags. I think a For git this would be:
The reason I like letting each VCS do the work is because of things like, for example, all the locations that git looks for it's ignore information. It's not just the |
@jfelchner |
@blueyed that's what |
@samaursa, let's reuse this issue here. The gitignore syntax is not supported. Git is so popular. So supporting this feature is important to get the minds of users. |
For the time being I still recommend to use a wrapper script #!/bin/sh
rg --files | ctags -R --links=no -L - |
@masatake I agree. @blueyed that is a good interim solution! it works well with plugins with custom command support such as https://github.com/ludovicchabant/vim-gutentags. Thanks! For anyone who stumbles on this in the future and uses
|
I'm quite happy if you make a pull request adding the tips (editor neutral part) to https://github.com/universal-ctags/ctags/blob/master/man/ctags.1.rst.in#L625 . Adding "TIPS" section is another approach. Thanks in advance. |
@samaursa This call |
where possible per universal-ctags/ctags#218
I have thought "Support for .gitignore in configuration" is a good idea for years. |
I want CTags to ignore the files listed in my gitignore. Would this be something that would be desirable for many? If so, I will dive into some code any see what I can do.
The text was updated successfully, but these errors were encountered: