-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enable tree-sitter for .zshrc and .bashrc #1460
Conversation
// we can't use the `extension` methods here because it ignore | ||
// empty file name with only an extension like `.bashrc`. | ||
path.file_name() | ||
.map(|file_name| file_name.to_str()) | ||
.flatten() | ||
.map(|file_name| file_name.rsplit('.').next()) | ||
.flatten() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC currently .gitconfig
already works since that is used for tree-sitter-git-config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huum from what I see, no, it doesn’t work with git-config on master currently 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see highlights working on master for .gitmodules
/.gitconfig
(i.e. cargo run .gitmodules
). That's not working for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to update your submodules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not really good with submodules, is there a way to update my submodule more than that?
https://asciinema.org/a/tmOpnwQAFWhcWkJD3dFQJoIed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, I think if you cargo clean -p helix-syntax
after the submodule update and then cargo run ~/.gitconfig
, that might do it. You can also add a --force
on the end of that submodules command iirc, and that forces them to be checked out again at whatever revision git thinks they should be.
btw the animal emojis on your shell are awesome! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't think this needs to be changed, file_name
will return .bashrc
so specifying ".bashrc"
in TOML should be enough.
// we can't use the `extension` methods here because it ignore | ||
// empty file name with only an extension like `.bashrc`. | ||
path.file_name() | ||
.map(|file_name| file_name.to_str()) | ||
.flatten() | ||
.map(|file_name| file_name.rsplit('.').next()) | ||
.flatten() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't think this needs to be changed, file_name
will return .bashrc
so specifying ".bashrc"
in TOML should be enough.
This commit builds on helix-editor#1460, helix-editor#1571, and others, adding the .zshenv file and all files with the zsh extension to the file-types using bash syntax-highlighting.
This commit builds on helix-editor#1460, helix-editor#1571, and others, adding the .zshenv file and all files with the zsh extension to the file-types using bash syntax-highlighting.
This commit builds on helix-editor#1460, helix-editor#1571, and others, adding the .zshenv file and all files with the zsh extension to the file-types using bash syntax-highlighting.
There is no « official » support for zsh currently but tree-sitters for bash is quite good already, and they even accepted a PR one month ago that adds some special handling for zsh so I think we can use it as-is.