Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Substantial reorganization of syntax highlighting file#80

Closed
rsaihe wants to merge 10 commits intoziglang:masterfrom
selenebun:master
Closed

Substantial reorganization of syntax highlighting file#80
rsaihe wants to merge 10 commits intoziglang:masterfrom
selenebun:master

Conversation

@rsaihe
Copy link
Contributor

@rsaihe rsaihe commented Aug 16, 2022

As discussed in the Zig Programming Language Discord, I have been working on rewriting the entire zig.vim plugin from scratch. This pull request contains all of the improvements I have made to syntax highlighting and heavily reorganizes the syntax file to hopefully make it more maintainable for the future.

rsaihe and others added 10 commits September 30, 2021 12:38
This commit is a substantial reorganization and general cleanup of
existing keywords. Several highlight groups have been adjusted and
compiler builtins that no longer exist have been removed.
The previous syntax highlighting did not match all valid arbitrary
bit-width integer types. This commit allows those with leading zeros to
be highlighted as well.
This commit heavily reorganizes the syntax highlighting for strings and
characters and adds new support for format strings.
This commit reorganizes the syntax file into several sections. The
heading of each section can be folded with :set foldmethod=marker.
@haze
Copy link
Contributor

haze commented Oct 31, 2022

@rsaihe I forgot where we left off on this, I know the last time I had asked there hasn't been much progress. I want to ask, does this fix some of the weird indentation rules for zig? Also, if you no longer want to work on this or can't, is it okay if I finish up?

@rsaihe
Copy link
Contributor Author

rsaihe commented Nov 2, 2022

This is only syntax highlighting, but I did manage to fix a lot of cases of incorrect indentation in my personal Vim plugin for Zig (found here). I don't have much energy right now to move my indentation changes into a pull request but you are totally free to use what I have there.

@haze haze self-assigned this Nov 2, 2022
atweiden added a commit to atweiden/zig.vim that referenced this pull request Nov 19, 2022
@matu3ba
Copy link

matu3ba commented Dec 30, 2022

@haze What is the status of this? I'd like to lookup the color rules to document necessary changes for semantic tokens and treesitter color rules by zls and treesitter-zig to match the provided colors here.

Specifically I am annoyed that control flow instructions do not have a special rule within semantic tokens to highlight it properly.

atweiden added a commit to atweiden/zig.vim that referenced this pull request Jan 4, 2023
atweiden added a commit to atweiden/zig.vim that referenced this pull request Feb 28, 2023
@atweiden
Copy link
Contributor

I’ve incorporated some of the standout features of #80 minus the reorg in the develop branch at https://github.com/atweiden/zig.vim, in addition to a few recent pull requests. IIRC I haven’t done anything with #80’s string handling yet.

As a point of differentiation compared to #80, besides not reorging, it handles @"" variables by |hl-Ignore|ing the @"" chars and highlighting the name of the variable the same as any other variable. Feedback has been negative on using hl-Ignore in the past, but I kind of don’t mind it. Not to digress too much, but it might be better for colorscheme authors to implement custom colouring for the @"" chars in Zig (similar to how many colorschemes implement custom handling of select filetypes already).

atweiden added a commit to atweiden/zig.vim that referenced this pull request Jul 21, 2023
atweiden added a commit to atweiden/zig.vim that referenced this pull request Aug 31, 2023
atweiden added a commit to atweiden/zig.vim that referenced this pull request Oct 7, 2023
atweiden added a commit to atweiden/zig.vim that referenced this pull request Nov 6, 2023
atweiden added a commit to atweiden/zig.vim that referenced this pull request Jan 2, 2025
atweiden added a commit to atweiden/zig.vim that referenced this pull request Apr 12, 2025
atweiden added a commit to atweiden/zig.vim that referenced this pull request Sep 10, 2025
@Techatrix
Copy link
Collaborator

Closing this PR as it has gone stale and now conflicts with master (#110). Feel free to rebase and submit a new PR.

@Techatrix Techatrix closed this Sep 26, 2025
@selenebun
Copy link

Oh, excellent! I'm very glad to see new development happening.

As a complete coincidence, I actually started tinkering again with my own version of this plugin just a few weeks ago, using what I've learned from maintaining hare.vim. I hadn't touched it in a couple years (due to burnout), but I've been making very good progress and would be more than happy to send some new PRs incorporating some of those changes!

I'm also very much looking forward to the Vim runtime files finally being updated again too, once everything is in a good place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants