Replies: 3 comments 4 replies
-
There's already a published tree-sitter grammar that's been published for rainbow CSV coloring. Here's how it looks when used in Helix: You can add it to Helix with this in ~/.config/helix/languages.toml: [[language]]
name = "csv"
file-types = ["csv"]
scope = "source.csv"
[[grammar]]
name = "csv"
source.git = "https://github.com/weartist/rainbow-csv-tree-sitter"
source.rev = "896e6d09b23a1b0d87e45bf97ca34a249f41495c" Then:
Then place this in ; Literals
(second)@keyword
(third)@function.method
(fourth)@number
(fifth)@comment
(sixth)@type
(seventh)@operator If there's interest in Helix supporting this "out of the box", I could see about figuring how to submit a PR to add this as one of the built-in supported languages. Yes, it's sort of abusing the query system to generate the rainbow colors, but as an exceptional case, this seems like the most useful way to look at CSV files in a text editor. |
Beta Was this translation helpful? Give feedback.
-
Rainbow coloring is nice but nothing beats indentation. Can this also be achieved via a simple trick? I envy https://marketplace.visualstudio.com/items?itemName=janisdd.vscode-edit-csv users. |
Beta Was this translation helpful? Give feedback.
-
In the meantime https://github.com/wfxr/csview |
Beta Was this translation helpful? Give feedback.
-
It would be useful to have some sugar for editing CSV files, which is difficult to do accurately a lot of the time without something like mechatroner/rainbow_csv: 🌈Rainbow CSV - Vim plugin: Highlight columns in CSV and TSV files and run queries in SQL-like language.
Beta Was this translation helpful? Give feedback.
All reactions