Skip to content
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

Closed

Conversation

irevoire
Copy link
Contributor

@irevoire irevoire commented Jan 8, 2022

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.

Comment on lines +311 to +317
// 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()
Copy link
Contributor

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.

Copy link
Contributor Author

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 🤔

Copy link
Member

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?

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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! 😄

Copy link
Member

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.

Comment on lines +311 to +317
// 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()
Copy link
Member

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.

@archseer archseer closed this in 7d51042 Jan 23, 2022
EricCrosson added a commit to EricCrosson/helix that referenced this pull request Jan 24, 2022
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.
EricCrosson added a commit to EricCrosson/helix that referenced this pull request Jan 24, 2022
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.
EricCrosson added a commit to EricCrosson/helix that referenced this pull request Jan 24, 2022
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.
pickfire pushed a commit that referenced this pull request Jan 24, 2022
This commit builds on #1460, #1571, and others, adding the .zshenv
file and all files with the zsh extension to the file-types using
bash syntax-highlighting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants