-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow NERDTreeIgnore to use paths. #737
Comments
This may require a new option, or an expansion of the meaning of the |
@aemonge Disregarding your feature request for a moment, can you confirm your setting is working properly? The way I read it, NERDTree will hide all directories that contain any other character that is not
involves some uncommon regex complexity. Using this StackOverflow thread and
Of course this doesn't address your feature request, and outside of the bower_components directory, all directories disappear. To get them back, you need to toggle the file filters with the I had fun discovering this lesser known capability in regular expressions. Thanks for the question. |
@PhilRunninger, thanks a lot for the correction of the RegExp, endeed the final version would have to use your fixed version with @lifecrisis new feature for path 👍 |
Why not use |
@juanibiapina could you provide the function that would work ? I'm not really used to vimscript so I don't really know how to do it. So far I've got until here:
Trying to get a regex to filter the result. Also I would like to get relative path, or PWD |
I've progressed a little bit, but I finally got stucked with the regex. My updated code is as follows:
My intension is to hide all folder inside (./bower_components) that have not a pre |
You can use path.str() to get a full path representation, should make it easier. For a relative path, check the documentation of path.str() also. I think strForEdit should be relative. And if you're having trouble with the regexp, do it in two steps, it's more readable anyway. Check if it matches bower_components and then your next thing. |
Ohhh !!! Yes!!! I got complicated without need, OFC ! thanks! |
Finall working result:
|
Hey @aemonge, thanks for working through this. Also, @juanibiapina, thanks for helping out. @aemonge, are you satisfied enough to close the issue? |
Yes ! |
So I know
let NERDTreeIgnore=['[^pre].*[[dir]]']
will hide all the directories that don't start with pre as a prefix. But I would like to apply that rule only to directories under bower_components directory.Ideally something like these two options:
let NERDTreeIgnore=['bower_components\/[^pre].*[[dir]]']
let NERDTreeIgnore=['bower_components\/[^pre].*[[path]]']
The text was updated successfully, but these errors were encountered: