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

Add fstab syntax definitions #696

Merged
merged 2 commits into from
Oct 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions assets/syntaxes/Fstab.sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: fstab
file_extensions:
- fstab
scope: source.fstab

contexts:
main:
- match: '^\s*\#.*'
scope: comment.line.number-sign
comment: just a comment line
- match: ^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(0|1)\s+(0|1|2)\s*$
captures:
1: entity.name.device.fstab
2: entity.name.mountpoint.fstab
3: entity.name.type.fstab
4: entity.name.options.fstab
5: constant.numeric.dump.fstab
6: constant.numeric.pass.fstab
comment: a valid fstab line with 6 space-separated token groups
- match: '^.*$'
scope: invalid.illegal.fstab
comment: everything else, probably an error