-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Ignoring files #171
Comments
Hi @NJAldwin, I published a new version, 6.9.4, that skips common editor temp files automatically as a first iteration for this feature, which can be expanded to be more configurable. Please try upgrading and let me know if the issue is resolved. |
Seems to be working correctly now. |
Glad you like it! 😊 |
I am having a similar problem with my text editor making files that I do not want nb to index. Was there ever a way implemented to ignore certain files? |
@tbdcit Is it possible to share an example filename? The filename for an item can be viewed with Currently # $_IGNORE_PATTERNS
#
# An array of filename patterns to ignore, formatted as `sed -e` arguments.
_IGNORE_PATTERNS=(
-e '/~$/d'
-e '/^#.*#$/d'
-e '/\.swa?p$/d'
-e '/^\.#*/d'
) If the files have a standard naming format, then we can add or expand a pattern to ignore them. |
The files I want to ignore are `*_ltex.json` these are created by a `neovim` language tool plugin. Would it be possible to add a variable `$NB_IGNORE_PATTERNS` that gets read into the internal `$_IGNORE_PATTERNS` variable?
… On 3 Nov 2024, at 22:36, William Melody ***@***.***> wrote:
@tbdcit <https://github.com/tbdcit> Is it possible to share an example filename? The filename for an item can be viewed with nb show <id> --filename.
Currently nb ignores files that match a set of ignore patterns defined in the $_IGNORE_PATTERNS <https://github.com/xwmx/nb/blob/b055b9e47904a6e3732ec0bcbf0da0f2b97a690d/nb#L1455> variable:
# $_IGNORE_PATTERNS
#
# An array of filename patterns to ignore, formatted as `sed -e` arguments.
_IGNORE_PATTERNS=(
-e '/~$/d'
-e '/^#.*#$/d'
-e '/\.swa?p$/d'
-e '/^\.#*/d'
)
If the files have a standard naming format, then we can add or expand a pattern to ignore them.
—
Reply to this email directly, view it on GitHub <#171 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALGSETQFZKTSQD5XOECDXKLZ626RDAVCNFSM6AAAAABRDDCFW6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGY4DMNBZGU>.
You are receiving this because you were mentioned.
|
@tbdcit Thanks for the information. I added a pattern to ignore these files and that's now available in version 7.14.6. I'm still considering how to make this configurable. |
I've been trying out
nb
across a couple of environments and I love it so far!I often edit my files with
emacs
, which leaves<filename>~
and#<filename>#
files lying around in directories. I have these files ignored from git with my global gitignore (ref: Emacs gitignore); however, I've noticed they're still appearing in the index filesnb
uses, as well as in the nb cli itself.The current behavior makes sense -- a user might have local files that are gitignored but might still want to view/edit them in
nb
.However, I'd love to be able to explicitly denylist files like these from nb. Is there any way to apply global filters? a
.nbignore
file somewhere, perhaps?Apologies if this is documented somewhere, or if it's a dupe issue -- I did a quick search in both places and didn't see anything relevant. Maybe I'm the only one using
emacs
here 😄The text was updated successfully, but these errors were encountered: