HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
oils-for-unix
oils.vim
Vim Script2025–2025
oils-for-unix / oils.vim

oils.vim

Vim syntax highlighting for Oils

2Distinct people
6Mentions
1Explicit recommenders
17GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Vim syntax highlighting for Oils

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

> `[` in one context is an index, in another it’s test. vim can match both, but it can’t decide which meaning is active unless the outer mode is remembered. and that’s the gap…

chubot used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour6 dated mentions

Observed mentions: 2025-06-13 02:24:54 UTC to 2025-06-13 15:21:38 UTC.

0122025-06-13 02:00:00 UTC to 2025-06-13 03:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsJun 13, 02:002025-06-13 03:00:00 UTC to 2025-06-13 04:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-06-13 04:00:00 UTC to 2025-06-13 05:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 05:00:00 UTC to 2025-06-13 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 06:00:00 UTC to 2025-06-13 07:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-06-13 07:00:00 UTC to 2025-06-13 08:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-06-13 08:00:00 UTC to 2025-06-13 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJun 13, 08:002025-06-13 09:00:00 UTC to 2025-06-13 10:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 10:00:00 UTC to 2025-06-13 11:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 11:00:00 UTC to 2025-06-13 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 12:00:00 UTC to 2025-06-13 13:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 13:00:00 UTC to 2025-06-13 14:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 14:00:00 UTC to 2025-06-13 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-13 15:00:00 UTC to 2025-06-13 16:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsJun 13, 15:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jun 13, 02:002025-06-13 02:00:00 UTC2025-06-13 03:00:00 UTC110
Jun 13, 03:002025-06-13 03:00:00 UTC2025-06-13 04:00:00 UTC101
Jun 13, 04:002025-06-13 04:00:00 UTC2025-06-13 05:00:00 UTC000
Jun 13, 05:002025-06-13 05:00:00 UTC2025-06-13 06:00:00 UTC000
Jun 13, 06:002025-06-13 06:00:00 UTC2025-06-13 07:00:00 UTC101
Jun 13, 07:002025-06-13 07:00:00 UTC2025-06-13 08:00:00 UTC101
Jun 13, 08:002025-06-13 08:00:00 UTC2025-06-13 09:00:00 UTC000
Jun 13, 09:002025-06-13 09:00:00 UTC2025-06-13 10:00:00 UTC000
Jun 13, 10:002025-06-13 10:00:00 UTC2025-06-13 11:00:00 UTC000
Jun 13, 11:002025-06-13 11:00:00 UTC2025-06-13 12:00:00 UTC000
Jun 13, 12:002025-06-13 12:00:00 UTC2025-06-13 13:00:00 UTC000
Jun 13, 13:002025-06-13 13:00:00 UTC2025-06-13 14:00:00 UTC000
Jun 13, 14:002025-06-13 14:00:00 UTC2025-06-13 15:00:00 UTC000
Jun 13, 15:002025-06-13 15:00:00 UTC2025-06-13 16:00:00 UTC202

What Hacker News says

6 sources
chubot·Jun 13, 2025Recommendation phrase
> `[` in one context is an index, in another it’s test. vim can match both, but it can’t decide which meaning is active unless the outer mode is remembered. and that’s the gap ysh.vim solves exactly that problem. The [ in command mode (test) is not highlighted. In contrast, the [ within expressions like a[i] is highlighted (currently Normal, but you can make it any color - https://github.com/oils-for-unix/oils.vim/blob/main/syntax/l... ) Again I recommend trying it. Verify what you think the bugs are. I think you have some preconceptions based on using other Vim plugins. Vim's model is powerful enough to write good plugins, or bad plugins. That is one of the main points of this article.
In Three Algorithms for YSH Syntax Highlighting
Yeah after writing this highlighter, I started noticing what I consider bugs in other highlighters e.g. although Vim's syntax highlighting helped me learn shell, it highlights numbers like 'echo 42' in a special way, which is misleading, because shell doesn't have numbers. (On the other hand, YSH does, but not in 'echo 42' either!) On the other hand, there are also language design issues. Shell also allows MULTIPLE here docs, and I claim that ZERO syntax highlighters handle it correctly - https://github.com/oils-for-unix/oils.vim/blob/main/demo/bad... (YSH removes here docs in favor of Python-like multi-line strings) --- But the "surprise" in this article is that Vim is powerful, and you can write a good syntax highlighter or a bad one. There are many possible "programs" to write in this paradigm I'd also say "completely accurate" high
Read the rest
lighting doesn't really exist in practice, and is even problematic in theory. Tree-sitter grammars are not completely faithful to the original language, because the metalanguage is limited. And highlighters have to deal with incomplete code, so it's not clear what "two parsers being the same" means.
In Three Algorithms for YSH Syntax Highlighting
no memory of nesting It absolutely nests! Vim's model has recursion, and it works perfectly. Some details here: https://github.com/oils-for-unix/oils.vim/blob/main/doc/stag... This highlighter is extremely accurate, and I would call it correct. I list about 3 known issues here, and they are all fixable/expressible in Vim's model: https://github.com/oils-for-unix/oils.vim/blob/main/doc/algo... Please install it, and file bugs with any inaccuracies. If YSH code is valid, it should not be mis-highlighted. There is test data in false-postive.ysh and false-negative.ysh. Try to break it! --- There are lots of Vim/Textmate plugins that are buggy, but it doesn't mean that all such plugins are. generate semantic tokens outside I'd also say that this doesn't really help, since I believe Tree-sitter is the most common way of doing that. I sho
Read the rest
w at the top of the doc that Tree-sitter has issues in practice expressing shell (although admittedly it's not a fair comparison to YSH in Vim. Shell in Vim will have more problems, although in practice I find it pretty good)
In Three Algorithms for YSH Syntax Highlighting

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.