1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-03 18:51:44 +00:00

Compare commits

..

663 Commits

Author SHA1 Message Date
sharkdp 608cefb05c Bump version 2019-09-03 08:07:42 +02:00
dependabot-preview[bot] 8d0aa39181 Bump ansi_term from 0.12.0 to 0.12.1
Bumps [ansi_term](https://github.com/ogham/rust-ansi-term) from 0.12.0 to 0.12.1.
- [Release notes](https://github.com/ogham/rust-ansi-term/releases)
- [Commits](https://github.com/ogham/rust-ansi-term/compare/v0.12.0...v0.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-03 07:21:05 +02:00
David Peter 5815364206 Add packaging status from repology.org 2019-09-01 11:03:35 +02:00
sharkdp 79f016e15c Update syntaxes 2019-08-31 20:58:16 +02:00
sharkdp 26f9125ebb Re-formulate help text 2019-08-31 20:56:53 +02:00
sharkdp 9814eab13f Suppress warning in -A mode 2019-08-31 20:56:53 +02:00
sharkdp 82ca8804a2 Handle non-unicode characters in the preprocessor 2019-08-31 20:56:53 +02:00
pjsier b48b9fcf3b Display binary file content for bat -A 2019-08-31 20:56:53 +02:00
sharkdp c64ab29739 Update min. required rust version 2019-08-31 14:48:42 +02:00
sharkdp 83dd3fb551 Update man page 2019-08-31 14:47:04 +02:00
sharkdp ed345f2889 Fix headline 2019-08-31 14:44:11 +02:00
sharkdp d2492980c0 Update syntaxes and themes 2019-08-31 14:43:20 +02:00
sharkdp 47d5130764 Bump version 2019-08-31 14:43:04 +02:00
sharkdp 4ba45e2ba2 Add first version of 'man page' syntax, closes #523 2019-08-31 14:32:37 +02:00
sharkdp 7076ae5cd9 Update dependencies 2019-08-31 14:14:08 +02:00
sharkdp 2e71146801 Fix another instance of the 'bat cache' bug, closes #584 2019-08-31 14:13:36 +02:00
sharkdp f3824bad17 Add explicit terminal width for test 2019-08-31 13:46:48 +02:00
sharkdp ec908d5937 Run 'cargo fmt' 2019-08-31 13:46:48 +02:00
sharkdp 3a75d85b80 Add test for 'snip' feature 2019-08-31 13:46:48 +02:00
sharkdp 63d652dab5 Add 'dyn' keyword for trait references 2019-08-31 13:46:48 +02:00
Ethan P 7f2e61d579 Add new style component to separate multiple '--line-range's 2019-08-31 13:46:48 +02:00
sharkdp e289a2c698 Add short '-L' option as an alias for --list-languages 2019-08-31 13:22:16 +02:00
sharkdp 83a213bae7 Add 'strace' syntax, closes #599 2019-08-31 13:13:42 +02:00
sharkdp 3967e28ded Add SCSS and Sass syntax, closes #637 2019-08-31 13:09:38 +02:00
sharkdp 2dc2a3712a Add Verilog syntax, closes #616 2019-08-31 12:59:02 +02:00
sharkdp 10e0f9efb0 Install fish completions in DEB package, closes #554 2019-08-28 21:06:52 +02:00
dependabot-preview[bot] f8ea075e78 Bump console from 0.7.7 to 0.8.0
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.7 to 0.8.0.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.7.7...0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-26 21:44:57 +02:00
dependabot-preview[bot] c187dce2c2 Bump lazy_static from 1.3.0 to 1.4.0
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.3.0...1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-26 07:13:01 +02:00
dependabot-preview[bot] 108c907d69 Bump git2 from 0.9.2 to 0.10.0
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.9.2 to 0.10.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-curl-0.9.2...git2-curl-0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-24 08:47:50 +02:00
sharkdp 187a3b9341 Use consistent syntax for command-line options
closes #574
2019-08-15 21:57:32 +02:00
David Peter 9c2d4f6a51 Add libc6-dev dependency for aarch64 2019-08-10 15:58:13 +02:00
sharkdp c1126157d4 Re-enable aarch64 builds 2019-08-10 15:58:13 +02:00
dependabot-preview[bot] dcfa810112 Bump syntect from 3.2.0 to 3.2.1
Bumps [syntect](https://github.com/trishume/syntect) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/trishume/syntect/releases)
- [Changelog](https://github.com/trishume/syntect/blob/master/CHANGELOG.md)
- [Commits](https://github.com/trishume/syntect/compare/v3.2.0...v3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-10 14:06:13 +02:00
Dan Davison f963104006 Add GraphQL sublime syntax submodule 2019-08-10 13:17:02 +02:00
sharkdp 45e1c0ea6f Temporarily disable aarch64 2019-08-02 21:14:44 +02:00
sharkdp 590a1e9a4b Bump minimum supported version to 1.33 2019-08-02 21:00:33 +02:00
sharkdp 8e2c6abb13 Update dependencies 2019-08-02 20:57:16 +02:00
Wild Kat 28266ee441 use explicit dyn with Write to appease compiler 2019-08-02 18:50:55 +02:00
Ethan P 21821f1d4c Updated snapshot tests 2019-07-26 06:51:33 +02:00
Ethan P 772ce2e4fe Print a horizontal header line when 'grid' style without 'header' style 2019-07-26 06:51:33 +02:00
dependabot-preview[bot] 35ca1c5191 Bump atty from 0.2.12 to 0.2.13
Bumps [atty](https://github.com/softprops/atty) from 0.2.12 to 0.2.13.
- [Release notes](https://github.com/softprops/atty/releases)
- [Changelog](https://github.com/softprops/atty/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/atty/compare/0.2.12...0.2.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-25 21:34:19 +02:00
dependabot-preview[bot] 0cc60a1519 Bump wild from 2.0.1 to 2.0.2
Bumps [wild](https://gitlab.com/kornelski/wild) from 2.0.1 to 2.0.2.
- [Release notes](https://gitlab.com/kornelski/wild/tags)
- [Commits](https://gitlab.com/kornelski/wild/commits/master)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-24 21:50:05 +02:00
dependabot-preview[bot] ee6659dacf Bump ansi_term from 0.11.0 to 0.12.0
Bumps [ansi_term](https://github.com/ogham/rust-ansi-term) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/ogham/rust-ansi-term/releases)
- [Commits](https://github.com/ogham/rust-ansi-term/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-24 21:45:44 +02:00
sharkdp 76c615a304 Allow leading minus in '--terminal-width <value>'
closes #611
2019-07-24 21:44:25 +02:00
Igor Gnatenko e8c04672f0 Small improvements for Fedora instructions
Anything older than F29 is EOL now, so no need to mention it. Also in F29+ you can use standard `dnf install`.
2019-07-24 21:38:11 +02:00
dependabot-preview[bot] 7f5a5612e4 Bump atty from 0.2.11 to 0.2.12
Bumps [atty](https://github.com/softprops/atty) from 0.2.11 to 0.2.12.
- [Release notes](https://github.com/softprops/atty/releases)
- [Changelog](https://github.com/softprops/atty/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/atty/compare/0.2.11...0.2.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-12 07:15:42 +02:00
dependabot-preview[bot] eee5d424bb [Security] Bump smallvec from 0.6.9 to 0.6.10
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.9 to 0.6.10. **This update includes security fixes.**
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-07 15:34:01 +02:00
dependabot-preview[bot] e5311e4b30 Bump console from 0.7.6 to 0.7.7
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.6 to 0.7.7.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.7.6...0.7.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-05 14:34:15 +02:00
dependabot-preview[bot] a1b9334a44 Bump console from 0.7.5 to 0.7.6
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.5 to 0.7.6.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.7.5...0.7.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-20 10:04:08 +02:00
Chloe Kudryavtsev d86b7cf7e0 Add Alpine Linux installation instructions
Resolves #586
2019-06-11 07:40:23 +02:00
dependabot-preview[bot] 67834da681 Bump git2 from 0.9.0 to 0.9.1
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.9.0...0.9.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-10 11:15:51 +02:00
toku-sa-n dcdf8dfaa7 Add install instructions(ja) for Gentoo Users. 2019-06-09 17:50:18 +02:00
toku-sa-n 9a44fa11c0 Add install instructions for Gentoo Users. 2019-06-09 17:50:18 +02:00
sharkdp 4ee0b2e16d Merge branch 'issmirnov-ssh-config' 2019-06-07 08:17:17 +02:00
sharkdp 518997135e Merge branch 'ssh-config' of https://github.com/issmirnov/bat into issmirnov-ssh-config 2019-06-07 08:17:04 +02:00
Ivan Smirnov 69fc1caead Add support for "etc/hosts" files.
- Syntax author: https://github.com/brandonwamboldt/sublime-hosts

Since the upstream version only has a tmLanguage, added a sublime-syntax
file manually.
2019-06-07 08:02:38 +02:00
Ivan Smirnov 175dd4c290 Add SSH config syntax
Tested:
```
bash assets/create.sh
cargo build
target/debug/bat --language ssh_config ~/.ssh/config
```
2019-06-06 20:01:23 -07:00
dependabot-preview[bot] e9210c0f6c Bump git2 from 0.8.0 to 0.9.0
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-curl-0.8.0...0.9.0)
2019-06-05 07:17:09 +02:00
sharkdp 3795acbd17 Add '.env' (DotENV) syntax 2019-05-31 21:05:34 +02:00
sharkdp c7d08cfcfd Add 'requirements.txt' syntax 2019-05-31 20:58:08 +02:00
dependabot-preview[bot] 8ec96da9f0 Bump dirs from 2.0.0 to 2.0.1
Bumps [dirs](https://github.com/soc/dirs-rs) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/soc/dirs-rs/releases)
- [Commits](https://github.com/soc/dirs-rs/commits)
2019-05-31 08:57:04 +02:00
Fernando Mendes c9d7e3652b Enforce the creation of the full cache dir path
Fixes #576
2019-05-30 22:28:52 +02:00
Brice Waegeneire dfa024f9e6 Add Org mode syntax, closes sharkdp#36 2019-05-29 19:52:06 +02:00
dependabot-preview[bot] b2757cb461 Bump dirs from 1.0.5 to 2.0.0
Bumps [dirs](https://github.com/soc/dirs-rs) from 1.0.5 to 2.0.0.
- [Release notes](https://github.com/soc/dirs-rs/releases)
- [Commits](https://github.com/soc/dirs-rs/commits)
2019-05-28 21:32:57 +02:00
sharkdp 416a0fd439 Fix autocompletion-path 2019-05-15 23:24:37 +02:00
sharkdp 9b1b3dda14 Only print the header for empty files
Instead of printing
```
───────┬─────────────────────────────────────────────────────────
       │ File: some-file
───────┼─────────────────────────────────────────────────────────
───────┴─────────────────────────────────────────────────────────
```
for empty files, bat will now print
```
───────┬─────────────────────────────────────────────────────────
       │ File: some-file   <EMPTY>
───────┴─────────────────────────────────────────────────────────
```
2019-05-15 22:37:03 +02:00
sharkdp ae7db313a6 Update man page 2019-05-15 22:14:40 +02:00
sharkdp 3c4384990d Update syntaxes and themes 2019-05-15 22:12:02 +02:00
sharkdp 260814c377 Bump version to 0.11 2019-05-15 22:07:35 +02:00
sharkdp 3675a82a1b Update dependencies 2019-05-15 22:06:28 +02:00
sharkdp 5b2b594919 Revert "Run 'cargo fmt'" (outdated rustfmt)
This reverts commit dd40f7545d.
2019-05-15 08:07:08 +02:00
sharkdp 9d53ce6be6 Fix warning 2019-05-14 23:42:23 +02:00
sharkdp 51e05499a9 Update dependencies 2019-05-14 23:40:21 +02:00
sharkdp dd40f7545d Run 'cargo fmt' 2019-05-14 23:40:07 +02:00
sharkdp c709bf2103 Print a warning message instead of just '<BINARY>' 2019-05-14 23:35:22 +02:00
Maksim Panfilov f37dbb80a8 Added printing of "<BINARY>" for binary files in the interactive mode if header decorations are turned off 2019-05-14 23:35:22 +02:00
sharkdp 0a1e08da96 Extend help text for --terminal-width and --wrap, closes #535 2019-05-14 23:24:13 +02:00
Ethan P 06b8dcb7eb Update fish completions for new --list-languages format 2019-05-14 22:50:42 +02:00
Ethan P 493a4e719e Added non-interactive mode for --list-languages
This makes scripting it a lot easier and less hacky.
2019-05-14 22:50:42 +02:00
Ethan P 27e0ca98d9 Remove language completions for config files 2019-05-14 22:50:42 +02:00
Ethan P 1b2066c5f2 Add fish shell argument completions for --language option 2019-05-14 22:50:42 +02:00
dependabot[bot] 4ec3cdb5b8 Bump error-chain from 0.12.0 to 0.12.1
Bumps [error-chain](https://github.com/rust-lang-nursery/error-chain) from 0.12.0 to 0.12.1.
- [Release notes](https://github.com/rust-lang-nursery/error-chain/releases)
- [Changelog](https://github.com/rust-lang-nursery/error-chain/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang-nursery/error-chain/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 18:32:28 +02:00
sharkdp 72152296c7 Fix accidental printing of files named 'cache'
This also adds two regression tests, so this will hopefully not pop up
again.

closes #557
2019-05-10 17:55:46 -05:00
Ethan P 2b9d25df05 Replace iterator with string starts_with and ends_with 2019-05-10 17:52:35 -05:00
Ethan P cc8186103b Reformatted with cargo fmt. 2019-05-10 17:52:35 -05:00
Ethan P 0ad09df7ab Improved logic when encountering ANSI in character wrap mode
Fixes #551
2019-05-10 17:52:35 -05:00
Ethan P 7ef0fe091d Cleaned up terminal-width validation even more 2019-05-10 17:50:58 -05:00
Ethan P 89fcbb2b15 Cleaned up terminal-width validation slightly 2019-05-10 17:50:58 -05:00
Ethan P a7e2bb86cb Add validation for --terminal-width option 2019-05-10 17:50:58 -05:00
sharkdp 1ce0bc8e0d Slightly modified help text 2019-05-10 11:04:46 -05:00
Ethan P fde00eec98 Add -pp for plain styling and no pager 2019-05-10 11:01:02 -05:00
Mitchell Kember bb6594e691 Add 3 new themes: ansi-light, ansi-dark, base16
Also, interpret transparent colors (#RRGGBB00) as specifying a terminal
color palette number with RR. The three new themes use this.
2019-05-08 07:35:43 -05:00
rasmuskriest e7c5561df7 Update Chocolatey package name to bat 2019-04-25 17:58:15 +02:00
rasmuskriest 0aabbc03d7 Add Chocolatey package instructions 2019-04-25 17:58:15 +02:00
Alexander Hultnér 8a5b59febc Updated manual to include -H, --highlight-line <N> 2019-04-25 17:57:01 +02:00
Tim Sampson 7afdd44c43 cache/misc: be more cautious with bash 2019-04-25 17:52:21 +02:00
Tim Sampson d72549a873 add fish shell syntax definition 2019-04-25 17:52:21 +02:00
evdev 1ba8540e5f Updated packaging script to include manual fish shell completions 2019-04-13 10:59:22 +02:00
evdev a6cee4da67 Removed completions file accidentaly left in root dir 2019-04-13 10:59:22 +02:00
evdev cd6850947e Updated fish completions to include parameter completion for available themes, added cache subcommand completions 2019-04-13 10:59:22 +02:00
evdev 14bfedeb20 Updated fish completions to include parameter completion for flags: color, italic-text, decorations, paging, wrap 2019-04-13 10:59:22 +02:00
evdev 8fe65252f7 WIP: added manual minimal fish shell completions for current flags. Does not include flag sub-options like language lists or subcommands 2019-04-13 10:59:22 +02:00
evdev 5e9351445f WIP: added manual minimal fish shell completions for current flags. Does not include flag sub-options like language lists or subcommands 2019-04-13 10:59:22 +02:00
dependabot[bot] 2fdfb8de40 Bump escargot from 0.4.0 to 0.5.0
Bumps [escargot](https://github.com/crate-ci/escargot) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/crate-ci/escargot/releases)
- [Changelog](https://github.com/crate-ci/escargot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/escargot/compare/v0.4.0...v0.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 21:48:33 +02:00
dependabot[bot] f8c759edff Bump clap from 2.32.0 to 2.33.0
Bumps [clap](https://github.com/clap-rs/clap) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-08 13:00:03 +02:00
dependabot[bot] e34431f922 Bump assert_cmd from 0.11.0 to 0.11.1
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases)
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/assert_cmd/compare/v0.11.0...v0.11.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-04 21:11:46 +02:00
Björn c96927b550 Update F# syntax 2019-04-04 21:11:19 +02:00
Laurent Arnoud 921cc0d1cb Add copyright file on Debian package 2019-03-17 18:59:28 +01:00
dependabot[bot] dbc49e534a Bump syntect from 3.1.0 to 3.2.0
Bumps [syntect](https://github.com/trishume/syntect) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/trishume/syntect/releases)
- [Changelog](https://github.com/trishume/syntect/blob/master/CHANGELOG.md)
- [Commits](https://github.com/trishume/syntect/compare/v3.1.0...v3.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-11 06:37:16 +01:00
David Peter 7755ed79e0 Delete .DS_Store 2019-03-11 06:35:21 +01:00
Daniele Esposti 50aabf331d Updated minimum version of Rust 2019-03-09 07:43:41 +01:00
Daniele Esposti f259ff2920 Formatted code 2019-03-09 07:43:41 +01:00
Daniele Esposti 82f14121bd Applied linter fixes 2019-03-09 07:43:41 +01:00
Daniele Esposti a21ae614e6 Migrated to Rust 2018 2019-03-09 07:43:41 +01:00
dependabot[bot] b94c94e845 Bump lazy_static from 1.2.0 to 1.3.0
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.2.0...1.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-08 21:45:42 +01:00
dependabot[bot] 161d107ec3 Bump dirs from 1.0.4 to 1.0.5
Bumps [dirs](https://github.com/soc/dirs-rs) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/soc/dirs-rs/releases)
- [Commits](https://github.com/soc/dirs-rs/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-05 22:31:16 +01:00
dependabot[bot] ecf147fd96 Bump syntect from 3.0.2 to 3.1.0
Bumps [syntect](https://github.com/trishume/syntect) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/trishume/syntect/releases)
- [Changelog](https://github.com/trishume/syntect/blob/master/CHANGELOG.md)
- [Commits](https://github.com/trishume/syntect/compare/v3.0.2...v3.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-25 07:03:17 +01:00
sharkdp f0771d6532 Do not replace arguments to pager when --pager is used, closes #509 2019-02-18 20:28:44 +01:00
Geoff Shannon d8f28c177a Make fd link actually link to fd 2019-02-17 09:19:42 +01:00
David Peter fbee9df719 Add "git show" section 2019-02-11 22:04:22 +01:00
David Peter 6e9ca7d6dc Add "xclip" section 2019-02-11 22:01:03 +01:00
David Peter a9ec5c063a Add documentation about "tail -f" 2019-02-11 21:54:16 +01:00
David Peter 8470fd7173 Add "Integration with other tools" section 2019-02-11 21:38:18 +01:00
Reid Wagner 76b7418e35 Only print contents if file wasn't empty, or EOF wasn't first thing received from stdin. 2019-02-11 20:33:16 +01:00
Reid Wagner 10c5f79640 Revert "Check result of read_until, and return Error if 0, which indicates EOF was found before delimeter."
This reverts commit 61e888de7f.
2019-02-11 20:33:16 +01:00
sharkdp 9e11d66979 Handle UTF-16 encoding errors with replacement characters 2019-02-10 10:18:07 +01:00
sharkdp fa3244f7c1 Add test for UTF-16LE encoding 2019-02-10 10:18:07 +01:00
sharkdp 906774e6d3 Integration tests for single-line files 2019-02-10 10:18:07 +01:00
Reid Wagner cec9cc073c Add integration tests running bat with empty input files. 2019-02-08 23:30:33 +01:00
David Peter a16789a060 Update alternatives.md 2019-02-07 23:52:31 +01:00
sharkdp e09499b3df Move config-dir and cache-dir from 'bat cache' to 'bat' 2019-02-07 23:27:53 +01:00
sharkdp cff01d81fa Rename 'bat cache --init' to 'bat cache --build' 2019-02-07 23:27:53 +01:00
sharkdp 31608c9a03 Update syntaxes 2019-02-07 23:01:06 +01:00
sharkdp 357ce84c56 Bump version to 0.10 2019-02-07 23:00:40 +01:00
sharkdp 3a5c52641b Update assets/syntaxes/Packages 2019-02-07 22:53:18 +01:00
sharkdp 6e8fca5bb2 Replace less command line arguments only for PAGER 2019-02-07 22:37:33 +01:00
Park Juhyung 63c77383ce Ignore flags from PAGER env var if the program is 'less' 2019-02-07 22:37:33 +01:00
sharkdp 4df22e617f Update documentation 2019-02-07 22:19:32 +01:00
sharkdp 6473e8c1be Remove import 2019-02-07 22:19:32 +01:00
sharkdp 972a764a74 Simplify Optional handling 2019-02-07 22:19:32 +01:00
sharkdp 54143d1403 Add --cache-dir option 2019-02-07 22:19:32 +01:00
sharkdp 6523bbf62f Replace 'is_absolute_path' with map and filter 2019-02-07 22:19:32 +01:00
Lavi 05e2c2c66b removed compile errors and warnings on non-macs 2019-02-07 22:19:32 +01:00
Lavi 69227222b5 config and cache now check XDG env vars first
`XDG_CACHE_HOME` and `XDG_CONFIG_HOME` are checked first and fall-back
to `~/.cache/` and `~/.config/`.
2019-02-07 22:19:32 +01:00
Lavi 49af3e854b Set cache_dir on MacOS to ~/.cache/bat/ 2019-02-07 22:19:32 +01:00
Lavi 6a8e4757b7 Updated bat config dir for MacOs
Removed directories crate and using dirs_rs
Changed bat config file and cache dir on MacOs:
config: ~/.config/bat/config
cache: ~/.config/bat/cache/
2019-02-07 22:19:32 +01:00
Harald Hoyer 91deef8b13 add varlink syntax
Varlink is an interface description format and protocol that aims
to make services accessible to both humans and machines in the
simplest feasible way.

See: https://varlink.org/ and https://github.com/varlink/ for
more information
2019-02-07 07:40:22 +01:00
Reid Wagner 61e888de7f Check result of read_until, and return Error if 0, which indicates EOF was found before delimeter. 2019-02-07 07:32:28 +01:00
Okumura Takahiro f3f9f10f05 Add Jsonnet (*.jsonnet) syntax
Jsonnet: https://jsonnet.org/
sublime-syntax: https://github.com/gburiola/sublime-jsonnet-syntax
2019-02-04 23:28:39 +01:00
object_1037 29ffa2a832 add Fedora instructions 2019-02-03 12:58:04 +01:00
object_1037 42a873fdb8 update README-ja.md 2019-02-03 12:58:04 +01:00
dependabot[bot] 82f048aedb Bump assert_cmd from 0.10.2 to 0.11.0
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 0.10.2 to 0.11.0.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases)
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/assert_cmd/compare/v0.10.2...v0.11.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-29 08:13:31 +01:00
Benjamin Santos ae08785ec8 Add Terraform syntax 2019-01-28 20:09:56 +01:00
sharkdp a500629359 Completely disable generation of shell completion files 2019-01-26 19:11:54 +01:00
Gergely Gombos 724a5fac99 Fix Fedora instructions in README
Correct instructions regarding Fedora Modular repos.
2019-01-26 19:11:37 +01:00
sharkdp c483e49b92 Consistent naming for submodules 2019-01-20 10:22:35 +01:00
Benjamin 94c9b40694 Protobuf-syntax and ProtobufText syntax (#474) 2019-01-20 10:20:53 +01:00
dependabot[bot] 0c9dc3b257 Bump console from 0.7.3 to 0.7.5
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.3 to 0.7.5.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.7.3...0.7.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-18 07:25:29 +01:00
Benjamin Santos 3b5174bb1d Add syslog-syntax 2019-01-18 07:24:46 +01:00
David Peter 3324505383 Update README.md 2019-01-16 20:04:46 +01:00
dependabot[bot] de7872f8a8 Bump console from 0.7.2 to 0.7.3
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.7.2...0.7.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-14 09:12:12 +01:00
dependabot[bot] abf0229741 Bump escargot from 0.3.1 to 0.4.0
Bumps [escargot](https://github.com/crate-ci/escargot) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/crate-ci/escargot/releases)
- [Changelog](https://github.com/crate-ci/escargot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/escargot/compare/v0.3.1...v0.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-01 12:32:25 +01:00
dependabot[bot] e04bccd12d Bump console from 0.7.1 to 0.7.2
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-24 08:41:06 +01:00
David Peter 668c8a6703 Merge pull request #453 from sharkdp/line-highlight
Line highlight
2018-12-18 09:06:28 +01:00
sharkdp bd68684537 Fix the number of values to one 2018-12-16 22:35:22 +01:00
sharkdp c2847f6a9f Short options for line-range and highlight-line 2018-12-16 22:17:39 +01:00
sharkdp cf7ed042c1 Colorize the whole line 2018-12-16 21:53:15 +01:00
sharkdp 6b92814ea0 Allow for multiple highlighted lines 2018-12-16 21:00:18 +01:00
sharkdp a236a9b195 Merge branch 'master' of https://github.com/tskinn/bat into tskinn-master 2018-12-16 20:43:36 +01:00
sharkdp b68c5d8576 Bump minimum required Rust version to 1.30 2018-12-14 23:34:13 +01:00
sharkdp fee57d71d9 Print ANSI-reset code before newline
fixes #379
2018-12-14 23:34:13 +01:00
sharkdp 5d3205acc0 Add x86_64 Assembly manually 2018-12-14 23:07:11 +01:00
sharkdp 4e6816abd6 Remove problematic 'Assembly (x86_64)' submodule 2018-12-14 23:07:11 +01:00
dependabot[bot] 72e8036edc Bump git2 from 0.7.5 to 0.8.0
Bumps [git2](https://github.com/alexcrichton/git2-rs) from 0.7.5 to 0.8.0.
- [Release notes](https://github.com/alexcrichton/git2-rs/releases)
- [Commits](https://github.com/alexcrichton/git2-rs/compare/libgit2-sys-0.7.5...git2-curl-0.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-14 22:55:25 +01:00
sharkdp 397def1320 Omit launching of pager if NO file exists
closes #387
2018-12-14 22:53:31 +01:00
sharkdp d2d29180a7 Add ARM assembly 2018-12-14 22:52:57 +01:00
sharkdp 2f263c9fbf Add x86_64 assembly 2018-12-14 22:46:50 +01:00
ufuji1984 4ff360669f add quotes around filename
and make it more concise by using map_err
2018-12-11 22:24:52 +01:00
ufuji1984 549e5d7355 Report filename if File::open return Err
From issue #441
2018-12-11 22:24:52 +01:00
Markus Thömmes dd48d29c28 Add AsciiDoc syntax. 2018-12-11 21:12:29 +01:00
sharkdp 98ee5f7400 Add vimpager to alternatives, closes #429 2018-12-07 20:28:47 +01:00
dependabot[bot] 638c04c13e Bump console from 0.7.0 to 0.7.1
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.7.0...0.7.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-03 07:04:34 +01:00
David Peter b1c865acaa Update README.md 2018-12-02 22:02:39 +01:00
Lavi Blumberg d3d795ffb2 Removed confusing variable from examples in README.md
Removed confusing the variable `BAT_CONFIG_DIR` from examples because it
 is not a real configuration option for bat.
2018-12-02 20:19:12 +01:00
David Peter 0571c51487 Add copyright notice in MIT license 2018-12-02 18:35:29 +01:00
Ole Martin Ruud 348c9f3562 Enhance SyntaxMapping with impl Trait 2018-11-27 20:36:23 +01:00
Ole Martin Ruud 6b6a8f8e16 Fix doc comment typo 2018-11-27 20:34:32 +01:00
Keith Devens 6aa002850c Correct typo in readme 2018-11-26 20:11:25 +01:00
dependabot[bot] 49c22c8d39 Bump console from 0.6.2 to 0.7.0
Bumps [console](https://github.com/mitsuhiko/console) from 0.6.2 to 0.7.0.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.6.2...0.7.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-23 08:04:46 +01:00
dependabot[bot] 673caf6b59 Bump assert_cmd from 0.10.1 to 0.10.2
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases)
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/assert_cmd/compare/v0.10.1...v0.10.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-21 19:11:22 +01:00
David Peter e6ffab3cb4 Update assets/README.md 2018-11-19 18:48:36 +01:00
Jerome Leclanche 4e43f8fa74 Highlight XDG desktop entry as .ini file
Reference: https://standards.freedesktop.org/desktop-entry-spec/latest/
2018-11-19 18:48:36 +01:00
David Peter bac1b16885 Consistent spelling of "color" 2018-11-18 12:11:07 +01:00
Ahmed El Gabri 778a4929a8 Add twig support 2018-11-18 11:58:05 +01:00
sh-tech 5c22dd4248 add close tag 2018-11-15 08:53:03 +01:00
sh-tech 214cd0f8ea add link to original README 2018-11-15 08:53:03 +01:00
sh-tech 9fd61fcb6d add table of contents 2018-11-15 08:53:03 +01:00
sh-tech edf1d3b256 modify url 2018-11-15 08:53:03 +01:00
sh-tech eca47b2a28 translate Project goals, alternatives 2018-11-15 08:53:03 +01:00
sh-tech 62424e70d7 translate Customization 2018-11-15 08:53:03 +01:00
sh-tech 4791f15222 translate Installation 2018-11-15 08:53:03 +01:00
sh-tech 159f234b78 translate Key Features & How to Use 2018-11-15 08:53:03 +01:00
sh-tech 3ec96127f2 translate table of contents 2018-11-15 08:53:03 +01:00
sh-tech a9acb2711b copy README.md (NOT translate yet) 2018-11-15 08:53:03 +01:00
sharkdp a3182e68e4 Update .gitattributes 2018-11-12 21:49:19 +01:00
sharkdp 0691b18231 Add assets/.gitattributes 2018-11-11 14:50:59 +01:00
sharkdp c711cd1b2e Update .gitattributes 2018-11-11 14:50:05 +01:00
sharkdp 14e6b41a5f Add .gitattributes 2018-11-11 14:49:24 +01:00
Arnav Borborah 532af6556d Use Rust inclusive range (stable in 1.26) 2018-11-11 14:42:22 +01:00
David Peter 26717b0cd2 Update README.md 2018-11-11 14:39:04 +01:00
David Peter 1f177f0a1c Update README.md 2018-11-11 14:35:08 +01:00
David Peter 54c81fa543 Update README.md 2018-11-11 14:32:59 +01:00
David Peter 34dee9e3aa Updates for README 2018-11-11 14:28:18 +01:00
David Peter c073d4a118 Add new image 2018-11-11 13:19:34 +01:00
sharkdp e79c5516bf Bump version, update assets 2018-11-11 12:55:38 +01:00
sharkdp 4776c2a575 Update man page 2018-11-11 12:31:28 +01:00
sharkdp f98a96c1ed Update help text 2018-11-11 12:26:39 +01:00
sharkdp 8a3446d219 Update dependencies 2018-11-11 12:17:58 +01:00
David Peter 5d5bf616ca Update README.md 2018-11-11 12:17:15 +01:00
sharkdp b68c038db8 Update link to new issue 2018-11-11 11:08:08 +01:00
dependabot[bot] 1117d2f9cb Bump syntect from 3.0.1 to 3.0.2
Bumps [syntect](https://github.com/trishume/syntect) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/trishume/syntect/releases)
- [Changelog](https://github.com/trishume/syntect/blob/master/CHANGELOG.md)
- [Commits](https://github.com/trishume/syntect/compare/v3.0.1...v3.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-11 11:08:08 +01:00
David Peter d0ba5bcb32 Wording 2018-11-11 11:07:55 +01:00
Ricky f8d39d5624 Resolving requested changes 2018-11-11 11:07:55 +01:00
Ricky 9998e2eac6 Initial commit of updated README for config file formatting 2018-11-11 11:07:55 +01:00
sharkdp 7cac07d845 issue #383: Handle cases like PAGER=/usr/bin/bat 2018-11-06 19:53:32 +01:00
Rodrigo Orem 148caa1381 Fix code style 2018-11-06 19:35:41 +01:00
Rodrigo Orem ab27cac0cc Remove args when change from bat to less 2018-11-06 19:35:41 +01:00
Rodrigo Orem 01fcbf2183 Better placement of bat detection 2018-11-06 19:35:41 +01:00
Rodrigo Orem 8a0c30b385 Avoid endless bat executions with PAGER="bat"
From issue #383
2018-11-06 19:35:41 +01:00
Dany Marcoux bc21c4d0e0 Add openSUSE installation instructions 2018-11-06 19:21:33 +01:00
dependabot[bot] 0800562ba2 Bump content_inspector from 0.2.3 to 0.2.4
Bumps [content_inspector](https://github.com/sharkdp/content_inspector) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/sharkdp/content_inspector/releases)
- [Commits](https://github.com/sharkdp/content_inspector/compare/v0.2.3...v0.2.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-05 19:37:58 +01:00
sharkdp 1f9befbcd1 Update SHA1 in TOML submodule 2018-11-05 19:37:23 +01:00
sharkdp a5c779c518 Update path to TOML syntax remote 2018-11-05 19:23:44 +01:00
dependabot[bot] f37f100352 Bump lazy_static from 1.1.0 to 1.2.0
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.1.0...1.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-05 07:22:39 +01:00
Nisheet Sinvhal 18d1a3b973 Changed italics to use-italic-text in config
Better placing of italics in help and also added long_help for it
2018-11-04 19:40:05 +01:00
Nisheet Sinvhal dc10246bd2 Linting 2018-11-04 19:40:05 +01:00
Nisheet Sinvhal 44bdae0212 Linting 2018-11-04 19:40:05 +01:00
Nisheet Sinvhal 1ece38a4c4 Changed flag name 2018-11-04 19:40:05 +01:00
Nisheet Sinvhal e90308e1f8 italics enable|disable working 2018-11-04 19:40:05 +01:00
Nisheet Sinvhal d702d6740c Added args 2018-11-04 19:40:05 +01:00
sharkdp c6a526f99c Run 'cargo run' only once 2018-11-04 12:24:56 +01:00
sharkdp 278d841408 Move '--paging' arg to config file. 2018-11-04 11:19:49 +01:00
sharkdp 5f576f1ecf Remove all relevant environment variables during testing 2018-11-04 11:19:49 +01:00
sharkdp 48c6ea6b25 Simplify integration test setup 2018-11-04 11:19:49 +01:00
Ricky 558134f6c8 Changed to unwrap methods, added integration tests 2018-11-04 11:19:49 +01:00
Ricky 1dd57e6d7e Ran rust fmt 2018-11-04 11:19:49 +01:00
Ricky 20ba84d1fa Added in environment variable and the result is a file check in config.rs 2018-11-04 11:19:49 +01:00
sharkdp e81f9b23e6 Fix --show-all for UTF-16 encoding 2018-11-01 22:00:47 +01:00
sharkdp 50dc4a79b0 Display line-feed as instead of 2018-11-01 22:00:47 +01:00
sharkdp 8fa8f44706 Use character if tab-width == 1. 2018-11-01 22:00:47 +01:00
sharkdp ecd862d9ff Feature: Highlight non-printable characters
Adds a new `-A`/`--show-all` option (in analogy to GNU Linux `cat`s option) that
highlights non-printable characters like space, tab or newline.

This works in two steps:
- **Preprocessing**: replace space by `•`, replace tab by `├──┤`, replace
newline by `␤`, etc.
- **Highlighting**: Use a newly written Sublime syntax to highlight
these special symbols.

Note: This feature is not technically a drop-in replacement for GNU `cat`s
`--show-all` but it has the same purpose.
2018-11-01 22:00:47 +01:00
sharkdp cbed338c3a Remove generation code for tabs_ tests 2018-11-01 15:30:58 +01:00
sharkdp 4492d99556 Change default tab width to 4 2018-11-01 15:30:58 +01:00
sharkdp d96ee2261f Remove tab-related text 2018-11-01 15:30:58 +01:00
sharkdp dda27b253b Allow offset values in --terminal-width
Allows the `width` argument to `--terminal-width` to be an offset
instead of an absolute number. Examples:

    --terminal-width=80   # Set output width to 80 characters
    --terminal-width=-2   # Set output width to actual_width - 2

closes #376
2018-10-31 22:21:22 +01:00
sharkdp 78f26d0caf Temporarily disable shipping of shell completions
closes #372
2018-10-31 22:03:05 +01:00
David Peter abcd09f869 Remove commented-out code 2018-10-21 22:52:26 +02:00
Sindre Johansen 41a5ff039b Only use the last argument of {style,plain,number} 2018-10-21 22:52:26 +02:00
Sindre Johansen 155bad3862 Rustfmt 2018-10-21 22:52:26 +02:00
Sindre Johansen 7c98a1c901 When specifying style multiple times the last occurence wins
Closes: #367
2018-10-21 22:52:26 +02:00
David Peter c1246fcd53 Update help text 2018-10-21 22:42:11 +02:00
David Peter 9f401ea122 Update docstring 2018-10-21 22:42:11 +02:00
Park Juhyung 9c782fb692 Fix format error 2018-10-21 22:42:11 +02:00
Park Juhyung 154186a58d Add --pager option 2018-10-21 22:42:11 +02:00
David Peter b22a9f8fe3 Update README.md 2018-10-20 14:56:25 +02:00
David Peter 5219c40ed8 PAGER: Wrapper script is not needed anymore 2018-10-20 14:54:44 +02:00
sharkdp a25ee0e6fd Add sublime-snazzy theme 2018-10-20 11:32:25 +02:00
sharkdp 496e0bc046 Allow for multiple line ranges
See #23
2018-10-20 10:44:13 +02:00
sharkdp 7082fd09f0 Modify TravisCI caching policy 2018-10-19 23:06:25 +02:00
David Peter 857cc215b4 Move link to header line 2018-10-19 22:00:05 +02:00
yobrave 481268f018 Doc: add Chinese readme link
#251
2018-10-19 22:00:05 +02:00
sharkdp f7d9f49503 Remove leftovers from tab-tests 2018-10-19 21:57:35 +02:00
Lawrence Chou 88fcfd76aa cargo fmt 2018-10-19 21:04:46 +02:00
Lawrence Chou 76e34b29ec Avoid empty line in snapshot 2018-10-19 21:04:46 +02:00
Lawrence Chou 01984e1d02 Test 'tabs' with 'numbers' 2018-10-19 21:04:46 +02:00
Lawrence Chou 536390509f remove --wrap for now 2018-10-19 21:04:46 +02:00
Lawrence Chou 58198d0700 rewrite 6 snapshot tests as integration test 2018-10-19 21:04:46 +02:00
Lawrence Chou afc5aacb28 Move tabs_* snapshot tests to integration_tests 2018-10-19 21:04:46 +02:00
sharkdp 30b742e984 --map-syntax takes just one value 2018-10-17 23:27:44 +02:00
sharkdp 671deeef8c Update help text 2018-10-17 23:17:28 +02:00
sharkdp a892caeb33 Bump bat version to 0.8 2018-10-17 23:15:59 +02:00
sharkdp a770cbf25e Update assets 2018-10-17 23:14:07 +02:00
sharkdp 931c6e9414 Update man page 2018-10-17 23:13:50 +02:00
sharkdp 8dc7e2efa3 Add --config-file option 2018-10-17 23:08:37 +02:00
sharkdp 10965a6122 Implement syntax mapping
This adds a `-m`/`--map-syntax` option that allows users to (re)map
certain file extensions or file names to an existing syntax.

For example:
```
bat --map-syntax .config:json
```

The option can be use multiple times. Note that you can easily make
these mappings permanent by using `bat`s new configuration file.

closes #169
2018-10-17 23:08:19 +02:00
sharkdp e43d97dc15 Small cleanup 2018-10-17 21:12:23 +02:00
sharkdp 2c7087b8de Add integration tests for pager handling 2018-10-17 21:08:32 +02:00
sharkdp bb1f5aa841 Add proper handling of empty PAGER variables 2018-10-17 21:08:32 +02:00
sharkdp 2109a7830b Add error handling for parsing errors 2018-10-17 21:08:32 +02:00
sharkdp ec27c78a8a Remove duplicate 'extern crate' 2018-10-17 21:08:32 +02:00
Morten Linderud 67fe833bc8 Add arguments from PAGER/BAT_PAGER
Solves #352

Signed-off-by: Morten Linderud <morten@linderud.pw>
2018-10-17 21:08:32 +02:00
sharkdp e956225b4d Update syntect to 3.0.1
closes #314
2018-10-16 23:06:46 +02:00
sharkdp 314ec881ef Bump Rust version 2018-10-16 22:09:15 +02:00
sharkdp 25a6a55437 Revert "Fix for older version of Rust"
This reverts commit c530fadc44.
2018-10-16 22:09:15 +02:00
sharkdp 5bff4548be Add BAT_OPTS environment variable 2018-10-16 22:09:15 +02:00
sharkdp 866b9e16a8 Add error handling 2018-10-16 22:09:15 +02:00
sharkdp 5af176c94f Move transpose to util module 2018-10-16 22:09:15 +02:00
sharkdp 9e7da05459 Fix for older version of Rust 2018-10-16 22:09:15 +02:00
sharkdp 1ae02c65fb Fix include 2018-10-16 22:09:15 +02:00
sharkdp 495e7fd3b1 Add --no-config option 2018-10-16 22:09:15 +02:00
sharkdp b48f0fe389 Fix tests 2018-10-16 22:09:15 +02:00
sharkdp c19c704a43 Add more tests 2018-10-16 22:09:15 +02:00
sharkdp 693bd5929d Add possibility for spaces on a single line 2018-10-16 22:09:15 +02:00
sharkdp 8275b0436d Add simple configuration file
This allows users to create simple configuration file
(`~/.config/bat/config` on Linux) that has the following format:

    ```bash
    --flag1
    --flag2
    --option1=value1
    # lines beginning with '#' are ignored
    --option2=value2
    # empty lines and trailing whitespace are also ignored

    --option3=value3
    ```
2018-10-16 22:09:15 +02:00
sharkdp 278bde5cee Continue with output after "is directory"-error 2018-10-11 21:54:19 +02:00
Russ Taylor eee7e5a575 Removes duplicate explanation. 2018-10-11 20:58:44 +02:00
Russ Taylor ad7b634ee6 Fixes #328 - adds info for light backgrounds. 2018-10-11 20:58:44 +02:00
David Peter 1310f83c8d Update Docker alias for bat 2018-10-11 20:57:46 +02:00
David Peter 897b9e7030 Add Docker instructions, closes #331 2018-10-11 20:05:17 +02:00
sharkdp 1891e194b5 Add simple integration tests 2018-10-11 07:06:13 +02:00
Taylor cea05e9f22 be consistent 2018-10-10 22:19:40 -06:00
sharkdp d2d01b9fe8 Always remove the local cache when creating new assets 2018-10-10 21:49:03 +02:00
sharkdp 2a7851530d Fix formatting 2018-10-10 20:45:10 +02:00
Taylor 1a6709c2cb add line highlight 2018-10-09 22:25:33 -06:00
sharkdp 5842d58c01 Updates for syntect 3.0 2018-10-09 22:04:51 +02:00
Tim Sampson e3c71adba7 syntax: Add robot framework support 2018-10-09 20:27:01 +02:00
Merlin Göttlinger 504f28b3a1 Documented nix availability 2018-10-09 20:07:27 +02:00
Fredrik Fornwall d977ba9194 Update dependencies 2018-10-08 22:33:09 +02:00
Tim Sampson 9c09799e1f misc: add exec bit for create.sh 2018-10-08 20:20:05 +02:00
David Peter d83c93c805 Update README.md 2018-10-07 18:39:52 +02:00
sharkdp fc8fd1e63f cargo fmt 2018-10-07 17:49:38 +02:00
sharkdp 404d6a4a81 Update content_inspector version 2018-10-07 17:49:38 +02:00
sharkdp 25d96da4a2 Add support for UTF-16LE and UTF-16BE 2018-10-07 17:49:38 +02:00
sharkdp e97095b724 Use first-line detection for STDIN 2018-10-07 15:34:37 +02:00
sharkdp ce96df00b6 Do not display binary files in interactive mode
closes #248
2018-10-07 15:34:37 +02:00
sharkdp f98fc5f06a Simplify access to first line 2018-10-07 15:34:37 +02:00
sharkdp 1dbb4ef683 Update minimum Rust version to 1.27 2018-10-07 15:34:37 +02:00
sharkdp 0502a3bd4a Add first-line detection for all input types
closes #205
2018-10-07 15:34:37 +02:00
sharkdp 869cf6368c Add possibility to get first line 2018-10-07 15:34:37 +02:00
sharkdp 078228deac Add unit test for InputFileReader 2018-10-07 15:34:37 +02:00
sharkdp e09d7dabb8 Move snapshot tests into separate module 2018-10-07 15:34:37 +02:00
sharkdp 6d1cc8c2c8 Move read_line functionality to inputfile module 2018-10-07 15:34:37 +02:00
sharkdp 87f021078e Use dyn Trait for trait objects 2018-10-07 15:34:37 +02:00
sharkdp d5b0502419 Move get_reader into inputfile module 2018-10-07 15:34:37 +02:00
sharkdp 860f3e9006 Move InputFile to separate module 2018-10-07 15:34:37 +02:00
sharkdp 1be346a038 Add 'plain' version of bat to the benchmarks 2018-10-07 10:57:08 +02:00
sharkdp f9fd5e4851 Simplify -h help text 2018-10-07 10:43:39 +02:00
sharkdp da09f3877b Remove unnecessary scope 2018-10-07 10:09:10 +02:00
sharkdp e30e1bab2e Move theme-preview section into own paragraph 2018-10-06 21:12:12 +02:00
Russ Taylor f140f6da46 Fixes #273 - describes 'musl' builds. 2018-10-06 21:07:01 +02:00
Grégoire Paris 3446fdf5f2 Document how to rapidly preview theme on a file 2018-10-06 21:06:31 +02:00
sharkdp e1345cdc2a Update VimL syntax 2018-10-05 18:44:51 +02:00
sharkdp a2676ccc55 Workaround for #81 2018-10-04 11:09:41 +02:00
Richard Hozák b39e28d2c8 Add support for wildcards in Windows CMD (#329)
Windows does not support wildcard expansion in cmd, this adds 'wild' crate (as discussed in #309) that handles everything transparently, so wildcards work everywhere.

Fixes #309
2018-10-03 22:59:11 +02:00
davideGiovannini 0d71968615 Generate shell completions with clap during build (#327)
* Generate shell completions with clap during build

* Updated ci release script, added SHELL_COMPLETIONS_DIR override to build.rs and fixed dependency version
2018-10-03 09:39:30 +02:00
sharkdp 80da0dc619 run cargo fmt 2018-09-26 19:16:03 +02:00
sharkdp 64903bb858 Typo 2018-09-26 19:13:32 +02:00
sharkdp 3456ce1187 Add a small tutorial 2018-09-26 18:08:24 +02:00
sharkdp 886a5b3d24 Document the situation with less and scrolling
closes #312
closes #246
2018-09-26 18:03:46 +02:00
sharkdp 238482e5f3 Update syntax-set, fixes #314 2018-09-23 10:30:19 +02:00
Michal Nazarewicz 79b960e17e Use ansi_colours package for better true-colour approximation 2018-09-23 10:19:19 +02:00
sharkdp 6aa626f1c4 Document INI syntax modifications 2018-09-22 11:23:29 +02:00
Tuk Bredsdorff 1b30539493 Added Mercurial's hgrc-files to the list of INI-extensions 2018-09-22 11:23:29 +02:00
Katrin Leinweber 96b24d8a7e Fix typos 2018-09-20 19:16:51 +02:00
sharkdp 20b02e72b3 Disable wrapping when --style is plain
closes #289
2018-09-18 21:31:56 +02:00
eth-p 254efac9c2 Added section to README on using Cygwin. 2018-09-14 18:30:43 +02:00
Jeroen Hoek dcec322117 Update README (libz-dev may be required)
On Ubuntu 18.04 I had to install `cmake` as well as `libz-dev` to get
bat to compile.
2018-09-14 14:12:44 +02:00
Alexander Eimer d781156327 Adds ansible install instructions for ansible to readme 2018-09-12 23:06:33 +02:00
sharkdp 732750c274 Bump version 2018-09-12 22:03:48 +02:00
sharkdp 6b6baa3118 Update dependencies 2018-09-12 22:01:27 +02:00
sharkdp 54c434934e Bump version, update assets 2018-09-12 22:01:01 +02:00
sharkdp ad6e0a2581 Update man page 2018-09-12 22:00:28 +02:00
sharkdp bd619db3ca Mention BAT_STYLE in README.md 2018-09-12 21:57:54 +02:00
sharkdp e098eb43a2 Do not show file header for directories
This also adds a better error message.

closes #292
2018-09-12 21:53:41 +02:00
David Peter ea369ee17f Merge pull request #298 from ms2300/bat_style
#208 Added BAT_STYLE env variable functionality
2018-09-12 21:48:34 +02:00
sharkdp 63d32bc818 Merge remote-tracking branch 'upstream/master' into bat_style 2018-09-12 21:40:41 +02:00
sharkdp dccf8d8221 Use a more streamlined version of style-component collection 2018-09-12 21:35:23 +02:00
sharkdp 97129ab9d8 Add PowerShell syntax, closes #306 2018-09-12 20:53:49 +02:00
David Peter 52d0d6ca30 Merge pull request #302 from eth-p/feature-tabs
Tab expansion support.

closes #166 
closes #184
2018-09-12 20:50:05 +02:00
sharkdp a05494e9d9 Make tests more robust 2018-09-12 20:32:49 +02:00
sharkdp 84ac92efbb Fix test for --style=plain 2018-09-12 20:32:33 +02:00
sharkdp b4c6e412dc Make generate_snapshots script more robust 2018-09-12 20:28:42 +02:00
sharkdp 3e21d69a92 Re-generate files again 2018-09-12 20:28:30 +02:00
sharkdp b7690d4bb1 Undo change in sample.modified.rs 2018-09-12 20:28:21 +02:00
eth-p d404139ff7 Added validation for --tabs.
Also added a comment to explain what 0 represents.
2018-09-12 10:08:58 -07:00
eth-p 9ef1e9f792 Update snapshots. 2018-09-11 15:04:44 -07:00
eth-p 503fe0b641 Fix sample.modified.rs 2018-09-11 15:03:13 -07:00
eth-p 1807f9653c Merge remote-tracking branch 'upstream/master' into feature-tabs
# Conflicts:
#	src/printer.rs
2018-09-11 14:03:47 -07:00
eth-p 1e74f0e2a9 Ran cargo fmt. 2018-09-11 13:47:35 -07:00
eth-p c1e1f753cf Added three new snapshot tests for --tabs and --wrap. 2018-09-11 13:47:01 -07:00
eth-p d90797f8e9 Fixed tab expansion not working in --wrap=never mode. 2018-09-11 13:45:49 -07:00
eth-p b4096e5627 Moved tab expansion to happen after syntax highlighting. 2018-09-11 13:02:22 -07:00
shik Chen 4e3ab4d399 Query git diff only when needed
In large git repo like chromium, it takes too long time to query git
diff.
2018-09-11 21:09:38 +02:00
rachitchokshi f0d936763c provide armhf deb packages (#301)
* Enabled deb packaging for armhf architecture

closes #280.
2018-09-11 21:03:53 +02:00
ms2300 7897260bf0 BAT_STYLE accounts for multiple styles (ie numbers,header) 2018-09-10 21:58:19 -06:00
eth-p eb6e43b9a9 Disabled tab expansion when decorations and pager are not used. 2018-09-10 20:12:13 -07:00
eth-p 7cdcdbb31d Updated snapshots. 2018-09-10 19:20:09 -07:00
eth-p 9159341714 Modified snapshot tests to support tab expansion.
This changes how the files are named (to allow for snapshots that aren't
directly related to the --style argument) and fixes the
generate_snapshots.py script to work with the latest version of bat.

Three new tests are also introduced:
- tabs_4 - Tab expansion with a width of 4.
- tabs_8 - Tab expansion with a width of 8.
- tabs_passthrough - No tab expansion.
2018-09-10 19:19:43 -07:00
eth-p b23ff24ebc Added tab expansion preprocessing step. 2018-09-10 18:11:59 -07:00
Rogach e1ecc17f69 print additional newline if last line in input file was not terminated with a newline (fixes #299) 2018-09-10 22:18:16 +02:00
rachitchokshi 0fe3badf19 adding deb packaging for arm64 (#1) 2018-09-10 21:24:15 +02:00
rachitchokshi 89d4cb951a Updated before_deploy.bash to call version of strip specific to aarch64 target 2018-09-10 21:24:15 +02:00
rachitchokshi e9681bf22d Testing build by removing dependency 'libz-sys = "1.0.20"' 2018-09-10 21:24:15 +02:00
rachitchokshi 1b6df8a480 Enabled build target aarch64-unknown-linux-gnu for arm64 architecture 2018-09-10 21:24:15 +02:00
ms2300 cf24986edb Run formatting for bat_style changes 2018-09-10 00:07:46 -06:00
ms2300 b9c556a0b6 Updated long help to reflect BAT_STYLE changes 2018-09-09 18:35:40 -06:00
ms2300 9d6bde48fa Added BAT_STYLE env variable functionality 2018-09-09 18:28:04 -06:00
Aankhen d6c8fee044 README.md: Add Using bat on Windows 2018-09-09 12:22:05 +02:00
sharkdp 8b4abb03db Run 'cargo fmt' 2018-09-08 09:52:21 +02:00
eth-p 375cf76e15 Formatted for newest rustfmt. 2018-09-08 09:52:21 +02:00
eth-p 1a4acc435e Typo 2018-09-08 09:52:21 +02:00
eth-p d8030626f8 Automatically disable wrapping when style is plain. 2018-09-08 09:52:21 +02:00
eth-p fb61aa4f60 Wrapping disabled when --plain is used. (#289) 2018-09-08 09:52:21 +02:00
Aankhen 76df41fa97 src/output.rs: Handle less in a portable way. 2018-09-07 21:47:31 +02:00
Miguel Madrid Mencía 97efd75cee Add Crystal syntax 2018-09-05 23:45:09 +02:00
Shreyansh Chouhan 53d0c1deca Can read files named "cache" now, cache subcommand working too (#275)
Now if a cache file exists in the current directory, and the user passes
no arguments to the cache command, the cache file would be displayed.
If however the user uses cache command with arguments, the cache command
would be executed as normal regardless of whether the file cache exists
in the current directory or not.

Though now there won't be an error message displayed if the user uses the cache sub command without arguments in any directory that contains a file named cache.
2018-09-05 23:22:12 +02:00
David Peter 155179a07a Update alternatives.md 2018-09-05 22:01:42 +02:00
sharkdp ba00caf9c3 Add Swift syntax 2018-09-05 21:56:49 +02:00
sharkdp ac418ba21c Add PureScript syntax 2018-09-05 21:50:16 +02:00
sharkdp acde83af31 Add note about 'lesspipe', closes #242 2018-09-05 21:44:53 +02:00
sharkdp 021a68eb21 Add F# syntax, closes #284 2018-09-05 21:38:35 +02:00
David Peter 566aab3b05 Merge pull request #279 from tobenna/add-jsx-syntax
Add support for JSX in javascript and typescript
2018-09-05 21:33:50 +02:00
sharkdp f88eba6476 Add section concerning missing zlib-devel
closes #229
2018-09-05 21:13:43 +02:00
sharkdp 1d9e7ac4c2 Support "(/usr)/bin/less" as PAGER too
closes #271
2018-09-05 21:10:11 +02:00
David Peter 80ae2ecbf8 Merge branch 'master' into add-jsx-syntax 2018-09-05 20:51:03 +02:00
David Peter 96d4492d27 Merge pull request #282 from tobenna/support-cabal-syntax
Syntax highlighting for .cabal
2018-09-05 20:44:25 +02:00
David Peter c90f0b8e21 Merge branch 'master' into support-cabal-syntax 2018-09-05 20:43:50 +02:00
David Peter 4b866ab6af Merge branch 'master' into add-jsx-syntax 2018-09-05 20:36:31 +02:00
Tobenna 2dbd91e543 Add Dart syntax 2018-09-05 20:33:16 +02:00
Tobenna Ndu 785da3d9df Add support for cabal syntax 2018-09-05 14:42:27 +01:00
Tobenna d455cb7c32 Add support for JSX in javascript and typescript 2018-09-05 08:49:33 +01:00
sharkdp d2b4766f92 Small README update 2018-09-04 08:25:24 +02:00
Roald 5cf92b4f94 Windows download with scoop 2018-09-04 08:23:38 +02:00
sharkdp 7b803a50af Ignore enable_ansi_support errors
- Call `enable_ansi_support` only once.
- Ignore errors that appear when trying to enable ANSI support. This
  will hopefully fix #252 and #264
2018-09-03 22:15:38 +02:00
sharkdp 67ec5fe2b7 Add OneHalf themes, closes #256 2018-09-03 22:12:41 +02:00
sharkdp 3447ed4def Add CSV syntax, closes #254 2018-09-03 21:49:26 +02:00
David Peter 532fb921a6 Update README.md 2018-09-01 00:59:30 +02:00
sharkdp ba4d5a2e7d Bump version number 2018-09-01 00:30:43 +02:00
sharkdp 026273a05c Enable ANSI support on Windows 2018-09-01 00:23:15 +02:00
sharkdp 8903b64830 Fix for Rust 1.26 2018-08-31 23:57:27 +02:00
sharkdp 194155f062 Fix relative-path computation for Windows 2018-08-31 23:57:27 +02:00
sharkdp a6ff3b900d Fix terminal width to 80 characters in tests 2018-08-31 23:57:27 +02:00
sharkdp 8a52bcf92d Add hidden --terminal-width option 2018-08-31 23:57:27 +02:00
sharkdp 0b1535f63b Split snapshot tests into individual tests 2018-08-31 23:57:27 +02:00
sharkdp 0a5b3eaf3e Re-enable tests on windows 2018-08-31 23:57:27 +02:00
sharkdp 11294249f8 Add new key for AppVeyor 2018-08-31 23:57:27 +02:00
anykao 35a1236ad0 Update tests.rs 2018-08-31 23:57:27 +02:00
anykao af8da50c2c Update appveyor.yml 2018-08-31 23:57:27 +02:00
anykao 649d1e3df2 Update appveyor.yml 2018-08-31 23:57:27 +02:00
anykao 199cfd4519 Update appveyor.yml 2018-08-31 23:57:27 +02:00
David Peter c7cce0752b Add AppVeyor badge 2018-08-31 23:57:27 +02:00
anykao 3a89486189 Create before_deploy.ps1 2018-08-31 23:57:27 +02:00
anykao 720a2fb7a5 Create appveyor.yml 2018-08-31 23:57:27 +02:00
sharkdp e3c990f11e Respect color settings for list-themes and list-languages 2018-08-31 21:57:18 +02:00
sharkdp 90c7d0c365 Use stdout locks 2018-08-31 21:48:26 +02:00
mchlrhw 56002267d2 Fix panic when running bat --list-languages | head
Fixes: https://github.com/sharkdp/bat/issues/232
2018-08-31 21:43:49 +02:00
David Peter 84734eac9d Update alternatives.md 2018-08-31 00:39:26 +02:00
sharkdp acdea97e71 Add --plain 2018-08-28 23:37:49 +02:00
sharkdp 839e4ee611 Bump version 2018-08-28 23:21:35 +02:00
sharkdp c7afcdebf8 Move theme_preview file to constant 2018-08-28 22:16:42 +02:00
sharkdp 08e6db1581 Add Troubleshooting section
see #220
2018-08-28 22:08:34 +02:00
sharkdp 4d08ecd828 Fix headline levels 2018-08-28 21:04:41 +02:00
sharkdp 28e1d0e613 Add development section to README 2018-08-28 21:03:03 +02:00
sharkdp d11839ad03 Update install instructions 2018-08-28 20:55:15 +02:00
sharkdp 8cacd9b432 Include theme_preview file in binary 2018-08-28 20:24:13 +02:00
sharkdp 6f67444c99 Run cargo fmt 2018-08-28 20:24:13 +02:00
sharkdp fd2b376ea0 Small style changes to --list-themes 2018-08-28 20:24:13 +02:00
sharkdp cda54e4f61 Fix build for Rust 1.26 2018-08-28 20:24:13 +02:00
ms2300 3b90ada735 Mutation done correctly 2018-08-28 20:24:13 +02:00
ms2300 1837d364fe Added bold to theme titles 2018-08-28 20:24:13 +02:00
ms2300 4ea3e6bbb7 Changed preview code 2018-08-28 20:24:13 +02:00
ms2300 38544ed735 Changed to plain style 2018-08-28 20:24:13 +02:00
ms2300 5444b0dfed Fixes mut issue 2018-08-28 20:24:13 +02:00
ms2300 f3dde0185d Modifying changing config for efficiency 2018-08-28 20:24:13 +02:00
ms2300 2e3784aa30 #213 : output hello world for each theme when --list-theme is flagged 2018-08-28 20:24:13 +02:00
sharkdp 1088455702 Add syntaxes for Elm, Kotlin, Puppet, TypeScript
closes #215
closes #216
closes #217
closes #218
2018-08-28 19:36:31 +02:00
Colin Dean 4f812c32ab Adds zenburn theme submodule
Work towards #224 but @sharkdp is going to rebuild themes.bin
2018-08-28 07:37:27 +02:00
sharkdp b6c59a5bd4 Add man page to releases 2018-08-27 23:10:14 +02:00
sharkdp b682679776 Add initial version of man page, see #52 2018-08-27 22:57:47 +02:00
ms2300 81771432fb #212 : added -p as an alias for --style=plain 2018-08-27 17:56:50 +02:00
sharkdp 627181bcb6 Always call the syntax highlighter 2018-08-23 23:35:57 +02:00
sharkdp 226d9a573a Add simple loop-through mode
Use a loop-through mode that simply copies input to output if a
non-interactive terminal is detected.

see #150
2018-08-23 23:13:24 +02:00
sharkdp 246cf79dbd Split into Controller and Printer 2018-08-23 22:37:27 +02:00
sharkdp ea955c734d Refactoring, introduce Printer trait 2018-08-23 19:44:14 +02:00
sharkdp 6223ad6d52 Document Config struct 2018-08-22 22:36:59 +02:00
sharkdp 31a9335bd5 Document Config struct 2018-08-22 22:36:37 +02:00
sharkdp 9316f2a758 Major refactoring and cleanup 2018-08-22 22:29:12 +02:00
sharkdp c884c3cc12 Re-order options in help texts 2018-08-22 19:34:30 +02:00
sharkdp 08850f0474 Update the --help text 2018-08-22 19:27:11 +02:00
Tim Sampson 8e6c5bc562 doc: mention BAT_THEME in help output 2018-08-22 18:14:01 +02:00
sharkdp 052425b12f Load customized themes in addition to defaults
- New themes in `$BAT_CONFIG_DIR/themes` are now loaded *in addition* to
  the default themes (they may also override).
- The `Default.tmTheme` symlink is not necessary anymore.

This relates to #172
2018-08-20 21:39:21 +02:00
sharkdp 2df3305b94 Add new '--blank' option for 'bat cache --init'
closes #206
2018-08-20 21:34:08 +02:00
sharkdp 6882fc1512 Clean up help messages 2018-08-20 21:34:08 +02:00
sharkdp 2508323264 Extract grid and line-number color from theme
This changes the output color of the grid and the line numbers to use
the "gutter" foreground color defined in the Sublime `.tmTheme` files.

Sublime Text does the same.

Note: we could go one step further and also extract the "GitGutter"
colors from the themes. These could be used instead of red/green/yellow
to signify Git modifications. The problem is that they are quite a bit
harder to extract from the syntect `Theme` object.

closes #178
2018-08-19 12:32:35 +02:00
sharkdp 297afad337 Bump version 2018-08-19 12:31:35 +02:00
sharkdp 1dddce3aa1 Separate syntax set and theme set
This commit separates the handling of syntax sets and theme sets. It
also changes the way how new syntax definitions are loaded from `bat`'s
configuration folder. New syntax definitions are now loaded *in
addition* to the ones that are stored in the `bat` binary by default.

This fixes #172
2018-08-19 11:08:23 +02:00
sharkdp 76be0d3933 Add arm as a compile target 2018-08-19 09:50:24 +02:00
sharkdp e5b8c4471a Bump minimum required rust version 2018-08-18 21:30:12 +02:00
sharkdp b191691767 Revert "replace trait object BufRead by generic"
This reverts commit 037861e588.
2018-08-18 21:25:58 +02:00
Michal Nazarewicz 5c95b8803b Avoid floating point arithmetic in RGB→8-bit ANSI approximation 2018-08-18 20:58:03 +02:00
sharkdp 5b421b455d Update dependencies 2018-08-18 20:44:25 +02:00
sharkdp a6d6c28723 Add documentation on new pager-customization 2018-08-18 20:22:11 +02:00
sharkdp 2966939e38 Update submodules 2018-08-18 19:30:35 +02:00
sharkdp d179693d1d Use BAT_PAGER and PAGER environment variables, closes #158 2018-08-18 18:48:22 +02:00
sharkdp 268577c6f9 Run 'cargo fmt' 2018-08-18 17:54:26 +02:00
TA Thanh Dinh 037861e588 replace trait object BufRead by generic 2018-08-18 17:54:26 +02:00
sharkdp 94ccc646e8 Update README 2018-07-23 21:58:06 +02:00
sharkdp 0cc5d1dab6 Update error-chain to fix compiler warnings 2018-07-23 21:54:30 +02:00
sharkdp 28397b8f78 Always show a warning when theme is unknown 2018-07-23 21:51:49 +02:00
sharkdp c899849101 Use map instead of and_then(..Some(..)) 2018-07-23 21:51:49 +02:00
sharkdp bf53b64125 Small style fix 2018-07-23 21:51:49 +02:00
Armando Perez c68aa0f424 Allow specifying the theme via the BAT_THEME environment variable
The `--theme` command line option stills takes precedence and this
change preserves how errors are handled when it's used: If a theme name
that doesn't exist is specified using the argument, this error is fatal.
However, if a theme that doesn't exist is specified using the environment
variable, the error is logged to `stderr` and the "Default" theme is
loaded as a fallback.
2018-07-23 21:51:49 +02:00
sharkdp 6b57f4eebc Style changes 2018-07-18 00:06:24 +02:00
eth-p 0ddd388a29 Improve logic for SGR sequence passthrough 2018-07-18 00:06:24 +02:00
eth-p 34811b8161 Fix #182 2018-07-18 00:06:24 +02:00
David Peter 8b92aae23f Fix Travis link 2018-07-17 23:37:03 +02:00
sharkdp 3a0941cabe Update syntaxes.bin 2018-07-17 23:28:44 +02:00
sharkdp 52877c6d67 Add Nix syntax, closes #180 2018-07-17 23:28:31 +02:00
sharkdp 455de98a89 Update sublimehq/Packages, closes #183 2018-07-17 23:27:19 +02:00
Stéphane Campinas 8c6a74a6c5 typo 2018-07-06 19:09:53 +02:00
Gert Hulselmans 3f8b340ed8 Add AWK syntax. 2018-06-15 16:41:51 +02:00
sharkdp 65e6970907 Change help text for --line-range 2018-06-12 08:18:44 +02:00
sharkdp 90cc019482 Run 'cargo fmt' 2018-06-12 08:18:44 +02:00
Taylor eaf0b99d25 update 2018-06-12 08:18:44 +02:00
Taylor Skinner 3b1dcca5d0 use map() 2018-06-12 08:18:44 +02:00
Taylor Skinner 26dbdf4fa0 update line-ranges 2018-06-12 08:18:44 +02:00
Taylor Skinner 6691786d82 add line-range 2018-06-12 08:18:44 +02:00
Conrad Kleinespel 50209bfe21 updates archlinux install instructions 2018-06-08 16:15:27 +02:00
sharkdp c91511cca1 Always run snapshot test 2018-06-02 19:03:38 +02:00
sharkdp c9f7a0c126 Use separate Git repository for snapshot testing
closes #161
2018-06-02 19:00:05 +02:00
Ezinwa Okpoechi 69c798eafd Fix command typo 2018-06-01 17:01:28 +02:00
sharkdp 195d5e0e16 Update Cargo.lock 2018-06-01 00:35:20 +02:00
sharkdp 86c1777205 Skip snapshot test if Git is not available
closes #161
2018-06-01 00:33:39 +02:00
sharkdp 16874ab016 Exclude assets from upload 2018-05-31 23:49:02 +02:00
sharkdp bf5883f06f Updates for 0.4 2018-05-31 22:57:18 +02:00
sharkdp e27bdfc7d6 Fix clippy warnings 2018-05-31 15:27:55 +02:00
David Peter a7f4f202cb Update README.md 2018-05-30 21:32:40 +02:00
David Peter 397223374a Add TOC 2018-05-30 21:23:24 +02:00
David Peter 0c2da90fa4 Change color of crates.io badge 2018-05-30 21:10:14 +02:00
David Peter fe29da6e76 Add license badge 2018-05-30 21:02:40 +02:00
sharkdp 0eccfb50d9 Update header 2018-05-30 20:54:46 +02:00
sharkdp f74263e71d Update syntect 2018-05-30 20:50:50 +02:00
sharkdp 54f4896ced Update syntaxes, fix CMake syntax problem 2018-05-30 20:43:50 +02:00
sharkdp 9d92350cbb Use default Markdown syntax, closes #157 2018-05-30 20:40:02 +02:00
sharkdp 26d409db65 Add 'rouge' to list of alternatives 2018-05-30 19:24:30 +02:00
sharkdp 06cd4b2ce8 Add 'coderay' to list of alternatives 2018-05-30 19:16:08 +02:00
sharkdp a348a9f68e Handle syntax-set loading errors 2018-05-25 22:42:06 +02:00
sharkdp 39e2971e96 Add .ignore files to avoid searching asset folders 2018-05-25 17:44:50 +02:00
TA Thanh Dinh a13eb60df3 Using slice notation instead of as_ref 2018-05-25 17:38:54 +02:00
sharkdp 9342d0bb24 Explicitly specify which args override themselves 2018-05-24 22:53:23 +02:00
sharkdp 36d7250af2 Allow arguments to override themselves 2018-05-24 22:53:23 +02:00
Ezinwa Okpoechi 2ce8655167 Build bat before generating snapshots 2018-05-24 19:10:24 +02:00
Ezinwa Okpoechi a452467e06 Remove unnecessary space if there are no decorations 2018-05-24 19:10:24 +02:00
Ezinwa Okpoechi 2ea3758c4b Justify header when there are decorations but no grid 2018-05-24 19:10:24 +02:00
Gert Hulselmans 65bb4c7ee6 Print themes directory in error message if no themes could be loaded from it.
Before this patch:
    $ bat cache --init
    [bat error]: Could not load themes from '{}'

After:
    $ bat cache --init
    [bat error]: Could not load themes from '/home/user/.config/bat/themes'
2018-05-24 09:09:23 +02:00
sharkdp 556149ad3a Add comparison benchmark 2018-05-22 23:32:46 +02:00
Gert Hulselmans 33bbf25468 Fix launching of pager so text is interpreted as UTF-8 by default.
This fixes issue https://github.com/sharkdp/bat/issues/98
2018-05-22 22:41:58 +02:00
sharkdp 5ee8913538 Add logo header to README 2018-05-22 22:39:20 +02:00
David Peter 9b1c1c0271 Add more benchmark results 2018-05-22 22:27:25 +02:00
Ezinwa Okpoechi 2712d63a4b Move asset clearing to assets module 2018-05-21 23:20:45 +02:00
Ezinwa Okpoechi b21fb6bca8 Extract features to separate module 2018-05-21 23:20:45 +02:00
Ezinwa Okpoechi ee43377a9c Move colors to printer module 2018-05-21 19:24:02 +02:00
Ezinwa Okpoechi 120b33a9db Move output to separate module 2018-05-21 19:24:02 +02:00
sharkdp 17b37fedcb Add project goals and list of alternatives 2018-05-21 00:28:30 +02:00
sharkdp 1013cdd80a Bump version 2018-05-19 17:55:07 +02:00
sharkdp be0a2d6048 Extended help texts for '--help' 2018-05-19 17:54:05 +02:00
sharkdp d1a1943998 Add -u and -n options, see #134 2018-05-19 16:58:45 +02:00
sharkdp 2a9f5a24ed Permissive error handling, closes #17 2018-05-19 12:50:41 +02:00
sharkdp a0ae089c4a Reset line number to 0 for new files 2018-05-19 12:25:07 +02:00
sharkdp 96cc391f2d Skip '--quit-if-one-screen' for --paging=always
closes #97
2018-05-19 10:54:54 +02:00
sharkdp a1e1170319 Add a few popular Sublime Text themes 2018-05-18 20:41:40 +02:00
sharkdp 54a331d162 Add syntax docu, add VimL, CMake, INI, LESS syntax
closes #99
closes #106
2018-05-18 19:57:58 +02:00
sharkdp 5e3b17e6f7 Fix code formatting 2018-05-18 17:44:43 +02:00
eth-p 486e6a19cd Fixed #124 2018-05-18 17:44:43 +02:00
Ezinwa Okpoechi 247dfbee83 Extract syntax finding to assets module 2018-05-18 16:45:59 +02:00
Ezinwa Okpoechi 882931a77b Update snapshots 2018-05-18 16:44:34 +02:00
Ezinwa Okpoechi 12cb438aa4 Handle line with invalid UTF-8 2018-05-18 16:44:34 +02:00
Ezinwa Okpoechi d0782ef954 Add line with invalid UTF-8 2018-05-18 16:44:34 +02:00
sharkdp c826c2a438 Better error handling 2018-05-16 22:55:37 +02:00
sharkdp 9aa97b6c22 Update to latest syntect, closes #100 2018-05-16 22:55:37 +02:00
sharkdp f7890870ea Add syntax for Dockerfiles
closes #101
2018-05-16 22:04:12 +02:00
sharkdp 145b99f01c Include syntaxes and themes in repository
This changes a few things:

- All syntaxes and themes are now stored (as submodules) under
  assets/syntaxes and assets/themes

- The default directories for syntaxes and themes are "syntaxes"
  and "themes" (used to be "syntax" and "themes")

- The "bat cache" command can now take a `--source <dir>` and
  `--target <dir>` option.

- The cached files have been renamed to "themes.bin" and "syntaxes.bin"
2018-05-16 22:04:12 +02:00
Mateusz Piotrowski 9af1d2b891 Add FreeBSD installation instructions
Closes #41.
2018-05-16 20:25:14 +02:00
David Peter 2eee68599d Merge pull request #102 from eth-p/master
Added text wrapping. (Fixes #54)
2018-05-16 08:41:49 +02:00
eth-p d569693dab Formatted with newer cargo fmt.
It should pass all the checks now.
2018-05-16 08:29:41 +02:00
eth-p 900f61032d Fix #117 2018-05-15 14:09:51 -07:00
eth-p d0ca566979 Replace for_line and for_wrap with generate 2018-05-15 13:55:38 -07:00
eth-p a5a7dc14e4 Fix \r character being printed with wrapping enabled. 2018-05-14 14:36:08 -07:00
sharkdp 54b33c8c21 Add simple benchmark scripts 2018-05-14 22:20:26 +02:00
rleungx a5de77af4d address comment 2018-05-14 20:30:16 +02:00
rleungx 870ff7b538 sort the language listing 2018-05-14 20:30:16 +02:00
sharkdp 15b9acd12f Updates for new rustfmt 2018-05-14 19:04:13 +02:00
eth-p b327127f37 Split decorations into a separate file and optimized them a bit. 2018-05-13 18:44:07 -07:00
eth-p 9214a4a4f0 PR #102 Followed @sharkdp's suggestions 2018-05-13 12:45:16 -07:00
sharkdp fcecd97224 Add ansi_term import for Windows, see #107 2018-05-13 21:19:26 +02:00
eth-p 870b3c0daf PR #102 Followed @BrainMaestro's suggestions
Also ran cargo fmt.
2018-05-13 03:26:23 -07:00
sharkdp b9c780c8c8 Ignore errors when clearing cache, closes #91 2018-05-13 10:34:35 +02:00
sharkdp ca865f9d26 Enable ANSI support on Windows 10 2018-05-13 09:58:16 +02:00
sharkdp 3ee0e56315 Update create.sh script 2018-05-13 09:53:30 +02:00
Eric Davies 091b0b6437 Add Julia highlighting support 2018-05-13 09:53:00 +02:00
eth-p 9f005d115d Update snapshot test files. 2018-05-12 14:04:54 -07:00
eth-p b4cfc9633c Fix double spaces when outputting without wrapping. 2018-05-12 14:02:47 -07:00
eth-p f7e055b6b7 Merge branch 'master' of https://github.com/sharkdp/bat 2018-05-12 14:00:25 -07:00
eth-p d4b438b9d3 Fix padding, add --wrap argument, disable wrap for non-tty. (Fixed)
I'm not quite sure what was up with git on that last commit, but it's
all properly committed now.
2018-05-12 13:44:10 -07:00
eth-p cd26d403a3 Fix padding, add --wrap argument, disable wrap for non-tty.
Now bat(1) can be used like cat(1) again!
2018-05-12 13:23:33 -07:00
eth-p f95a23f948 Fix off-by-one error with text wrapping and --style grid 2018-05-12 12:07:41 -07:00
Ezinwa Okpoechi 0886a24685 Add snapshot testing 2018-05-12 18:07:30 +02:00
Ezinwa Okpoechi 53eb9c57d6 Add generated snapshots 2018-05-12 18:07:30 +02:00
Ezinwa Okpoechi 026a9ebae3 Add sample files and snapshot generator 2018-05-12 18:07:30 +02:00
Ethan P bdd10b8bec Merge branch 'master' into master 2018-05-12 06:40:47 -07:00
eth-p fc160b0dcd PR #102 Review Changes
- Reformatted code.
- Removed leftover code.
- Removed leftover comments.
- Fixed compiling on Rust 1.24.0
2018-05-12 06:32:23 -07:00
sharkdp cb7b158172 Add bold, italic and underline font styles 2018-05-12 13:23:39 +02:00
eth-p fcc36b1f79 Forgot to add styling to the horizontal line. 2018-05-11 22:49:26 -07:00
eth-p 4e4110bf50 Added line wrapping. 2018-05-11 21:59:26 -07:00
Ryan Leung 22c8978fca add theme option (#95)
closes #89
2018-05-11 13:53:17 +02:00
Ezinwa Okpoechi f711fb5006 Split style to separate module 2018-05-11 10:15:26 +02:00
Ezinwa Okpoechi 64a9341b73 Split app to separate module 2018-05-11 10:15:26 +02:00
sharkdp ccf88fd5d8 Add and use --style=auto by default 2018-05-10 16:22:24 +02:00
David Peter 6343535eb2 Add 32bit support (#87)
* Add 32bit support, closes #84
* Remove error-chain backtrace support
2018-05-10 14:36:05 +02:00
sharkdp e2ac6de783 Fix clippy warnings 2018-05-10 13:15:59 +02:00
Ezinwa Okpoechi 25cee002f9 Split modules (#86)
* Split diffing to separate module
* Split assets to separate module
2018-05-10 12:36:09 +02:00
sharkdp 13a53d230b Add MacOS install instructions, closes #33 2018-05-10 12:35:07 +02:00
sharkdp ea27053a63 Remove unused lifetimes 2018-05-10 12:20:38 +02:00
Pit Kleyersburg b2b932f3ed Fix header-line if grid is not requested 2018-05-10 12:20:38 +02:00
Pit Kleyersburg 747d074be1 Replace Cow by String 2018-05-10 12:20:38 +02:00
Pit Kleyersburg 61109ece15 Create OutputComponents struct, use HashSet 2018-05-10 12:20:38 +02:00
Pit Kleyersburg 389edd7239 Combine OutputComponents and PredefinedStyles
This commit tries to simply the change. Instead of separating an
`OutputComponent` and a `PredefinedStyle`, I have combined the two into
just `OutputComponent`.

To still have the styles work, I added an impl to `OutputComponent` with
a function `components` which returns the components related to the
specified component.

For a simple output component this is trivial, but for the predefined
styles this is a list of other components.

The evaluating of the command-line parameter simplified significantly,
making use of Claps `values_t!` macro to parse the supplied parameters
into a `Vec<OutputComponent>`. After that it is simply a task of
combining all supplied output components into one vector.

Important: this means that the styles are now additive, rather than one
of the predefined styles overruling other parameters supplied.
2018-05-10 12:20:38 +02:00
Pit Kleyersburg 23813cc08b Make --style parameter more flexible
The `--style` parameter now accepts a comma-separated list of strings,
where every element defines either a single output component (`changes`,
`grid`, `header`, `numbers`) or a predefined style (`full`,
`line-numbers`, `plain`).

If available, bat picks the first predefined style in the user-supplied
style-list and ignores everything else. If no predefined style was
requested, the other parameters that are simple output components will
be used.

Examples:

    --style changes,full,numbers

  Will internally be reduced to only the predefined style `full`.

    --style plain,full

  Will internally be reduced to only the predefined style `plain`.

    --style changes,numbers

  Will not be reduced, because the list does not contain any predefined
  styles.

(Note: if `grid` is requested but no other parameters, bat still creates
the left-most column with a width of `PANEL_WIDTH`. I didn't want to
introduce further logic in this PR that drops or adapts the width of the
left column.)
2018-05-10 12:20:38 +02:00
David Peter fdeb98e859 Add usage examples 2018-05-09 00:33:49 +02:00
David Peter 6a417886aa Add comment about paging & concatenation 2018-05-09 00:12:25 +02:00
sharkdp 8b9991d780 Append newline at the end of the file if necessary 2018-05-08 23:49:59 +02:00
sharkdp f59ddd1e36 Update dependencies 2018-05-08 23:49:07 +02:00
sharkdp f90b9d1acc Do not peek at FIFOs, closes #80 2018-05-08 23:23:41 +02:00
sharkdp f7af537018 Filter out languages without extensions 2018-05-08 22:57:29 +02:00
sharkdp fd68af8031 Paint file extensions in green 2018-05-08 22:57:29 +02:00
sharkdp ebdef04c8f Compute 'longest' for non-hidden languages only 2018-05-08 22:57:29 +02:00
sharkdp a4150600af Correctly update num_chars 2018-05-08 22:57:29 +02:00
Connor Kuehl 49223eed06 Remove term_width from Printer, its options owns it. 2018-05-08 22:57:29 +02:00
Connor Kuehl 7dc7133b3c Add revisions for line-wrapping and terminal width.
* Adds separator.length() to calculation for desired width.
* Replaces use of term_width with options.term_width.
* Adds the comma and space separator to calculation for line-wrapping.
2018-05-08 22:57:29 +02:00
Connor Kuehl e5e47716b0 Add term_width to options struct, move getting term_width to run() 2018-05-08 22:57:29 +02:00
Connor Kuehl b4f8cd3bae Filter out languages that are hidden. 2018-05-08 22:57:29 +02:00
Connor Kuehl ee3a37f3fc WIP edit desired width. 2018-05-08 22:57:29 +02:00
Connor Kuehl 4c60ab12cc Add simple line-wrapping for file extensions. 2018-05-08 22:57:29 +02:00
Connor Kuehl ac32dd17c9 Adds requested revisions.
* removes redundant `.takes_value(false)`.
* changes Arg name to "list-languages" to be consistent with long-form.
* replaces unnecessary match statement with is_present().
* replaces unnecessary match statement on iter and uses unwrap_or()
instead.
* replaces for-loop with a call to join().
2018-05-08 22:57:29 +02:00
Connor Kuehl 4e3c57cc7c Rename and add comment to the match block. 2018-05-08 22:57:29 +02:00
Connor Kuehl 438a9a99ed Size language name column width to the length of the longest language. 2018-05-08 22:57:29 +02:00
Connor Kuehl 9b0877102c Display language and extensions from loaded assets. 2018-05-08 22:57:29 +02:00
Connor Kuehl 67bed73e15 Add --list-languages argument to clap. 2018-05-08 22:57:29 +02:00
sharkdp ef7c39b159 Improve cache subcommand
* Remove the old `init-cache` subcommand

* Introduce a new `cache` subcommand that can be used like this:

    * `bat cache -h` - Show help
    * `bat cache --init` - Initialize cache from config dir
    * `bat cache --clear` - Reset the cache
    * `bat cache --config-dir` - Show config directory

* Update README

closes #44
2018-05-08 20:11:25 +02:00
sharkdp 8a399c8d7d Disable paging-mode if we read from an interactive TTY 2018-05-07 23:27:38 +02:00
sharkdp 9a0e444e09 Simplify stdout handling 2018-05-07 23:27:38 +02:00
sharkdp 438f3df345 Paint STDOUT bold, unify writeln statement 2018-05-07 23:27:38 +02:00
sharkdp 7e2e0c82ac Add support for reading from stdin, closes #2 2018-05-07 23:27:38 +02:00
sharkdp da92154163 Re-format README 2018-05-07 20:06:01 +02:00
sharkdp 179bd4f525 Mention cmake in build instructions, closes #57 2018-05-07 20:03:56 +02:00
Ezinwa Okpoechi 53d67e2b6e Add printer
This adds a separate struct that handles printing of the different
tokens.
2018-05-07 08:57:21 +02:00
sharkdp b625d07c34 Use syntect newlines mode (instead of nonewlines) 2018-05-06 19:50:48 +02:00
Ezinwa Okpoechi ec606e5dcc Add option to disable automatic paging 2018-05-06 19:50:05 +02:00
Ezinwa Okpoechi c253821a5e Open pager once for multiple files 2018-05-06 19:50:05 +02:00
sharkdp ccb1d78b22 Remove short versions for --style and --color for now 2018-05-06 18:23:43 +02:00
sharkdp 9eb64b97fe Discover syntaxes by name and extention 2018-05-06 18:20:35 +02:00
sharkdp 15f0268bdc Use 'plain' style for non-interactive terminals 2018-05-06 16:15:22 +02:00
sharkdp 3fa70deaa7 Run 'cargo fmt' and enforce via Travis 2018-05-06 15:10:46 +02:00
Ezinwa Okpoechi d4553c6b38 Add color flag
Colors are disabled if the terminal is not interactive unless explicitly
set otherwise
2018-05-06 14:47:53 +02:00
sharkdp 23d92d7641 Add TOML sublime syntax, closes #37 2018-05-06 14:34:10 +02:00
sharkdp 92729430fc Add elixir sublime syntax 2018-05-06 14:26:58 +02:00
sharkdp 3eb79d63ce Compute pathspec from absolute.strip_prefix(workdir) 2018-05-06 11:22:48 +02:00
Nakul Chaudhari 0483407775 Remove user specific change 2018-05-06 11:22:48 +02:00
Nakul Chaudhari cbdf5c50c4 Fix bug where git modification markers would not be shown if directory
was not cwd

Git ignore Idea dir

Fix #22
2018-05-06 11:22:48 +02:00
Ezinwa Okpoechi 418b3c5ea1 Add less pager 2018-05-05 09:01:30 +02:00
Nakul Chaudhari 9dca3126b3 Hide everything but content for plain option style
fix #5
2018-05-03 22:49:37 +02:00
nakulcg 7df9a5fe82 Add --style option to disable line numbers and git markers (#43)
closes #5
2018-05-03 20:34:23 +02:00
Ezinwa Okpoechi 4bba08062c Add option to specify language 2018-05-03 17:00:35 +02:00
166 changed files with 35578 additions and 929 deletions
+155
View File
@@ -0,0 +1,155 @@
[submodule "assets/syntaxes/Elixir"]
path = assets/syntaxes/Elixir
url = https://github.com/princemaple/elixir-sublime-syntax/
[submodule "assets/syntaxes/Packages"]
path = assets/syntaxes/Packages
url = https://github.com/sublimehq/Packages/
[submodule "assets/syntaxes/TOML"]
path = assets/syntaxes/TOML
url = https://github.com/jasonwilliams/sublime_toml_highlighting
[submodule "assets/syntaxes/Julia"]
path = assets/syntaxes/Julia
url = https://github.com/JuliaEditorSupport/Julia-sublime
[submodule "assets/themes/sublime-monokai-extended"]
path = assets/themes/sublime-monokai-extended
url = https://github.com/jonschlinkert/sublime-monokai-extended
[submodule "assets/syntaxes/Docker"]
path = assets/syntaxes/Docker
url = https://github.com/asbjornenge/Docker.tmbundle
[submodule "assets/syntaxes/VimL"]
path = assets/syntaxes/VimL
url = https://github.com/SalGnt/Sublime-VimL
[submodule "assets/syntaxes/INI"]
path = assets/syntaxes/INI
url = https://github.com/clintberry/sublime-text-2-ini
[submodule "assets/syntaxes/CMake"]
path = assets/syntaxes/CMake
url = https://github.com/zyxar/Sublime-CMakeLists
[submodule "assets/syntaxes/LESS"]
path = assets/syntaxes/LESS
url = https://github.com/danro/LESS-sublime
[submodule "assets/themes/DarkNeon"]
path = assets/themes/DarkNeon
url = https://github.com/RainyDayMedia/DarkNeon
[submodule "assets/themes/github-sublime-theme"]
path = assets/themes/github-sublime-theme
url = https://github.com/AlexanderEkdahl/github-sublime-theme
[submodule "assets/themes/1337-Scheme"]
path = assets/themes/1337-Scheme
url = https://github.com/MarkMichos/1337-Scheme
[submodule "assets/themes/TwoDark"]
path = assets/themes/TwoDark
url = https://github.com/erremauro/TwoDark
[submodule "assets/syntaxes/AWK"]
path = assets/syntaxes/AWK
url = https://github.com/JohnNilsson/awk-sublime
[submodule "assets/syntaxes/Nix"]
path = assets/syntaxes/Nix
url = https://github.com/wmertens/sublime-nix
[submodule "assets/themes/zenburn"]
path = assets/themes/zenburn
url = https://github.com/colinta/zenburn.git
[submodule "assets/syntaxes/Kotlin"]
path = assets/syntaxes/Kotlin
url = https://github.com/vkostyukov/kotlin-sublime-package
[submodule "assets/syntaxes/Elm"]
path = assets/syntaxes/Elm
url = https://github.com/elm-community/SublimeElmLanguageSupport
[submodule "assets/syntaxes/TypeScript"]
path = assets/syntaxes/TypeScript
url = https://github.com/Microsoft/TypeScript-Sublime-Plugin
[submodule "assets/syntaxes/Puppet"]
path = assets/syntaxes/Puppet
url = https://github.com/russCloak/SublimePuppet
[submodule "assets/syntaxes/CSV"]
path = assets/syntaxes/CSV
url = https://github.com/wadetb/Sublime-Text-Advanced-CSV
[submodule "assets/themes/onehalf"]
path = assets/themes/onehalf
url = https://github.com/sonph/onehalf
[submodule "assets/syntaxes/JavaScript (Babel)"]
path = assets/syntaxes/JavaScript (Babel)
url = https://github.com/babel/babel-sublime
[submodule "assets/syntaxes/Cabal"]
path = assets/syntaxes/Cabal
url = https://github.com/SublimeHaskell/SublimeHaskell
[submodule "assets/syntaxes/Dart"]
path = assets/syntaxes/Dart
url = https://github.com/guillermooo/dart-sublime-bundle
[submodule "assets/syntaxes/FSharp"]
path = assets/syntaxes/FSharp
url = https://github.com/hoest/sublimetext-fsharp
[submodule "assets/syntaxes/PureScript"]
path = assets/syntaxes/PureScript
url = https://github.com/tellnobody1/sublime-purescript-syntax
[submodule "assets/syntaxes/Swift"]
path = assets/syntaxes/Swift
url = https://github.com/quiqueg/Swift-Sublime-Package
[submodule "assets/syntaxes/Crystal"]
path = assets/syntaxes/Crystal
url = https://github.com/crystal-lang-tools/sublime-crystal.git
[submodule "assets/syntaxes/PowerShell"]
path = assets/syntaxes/PowerShell
url = https://github.com/PowerShell/EditorSyntax
[submodule "assets/syntaxes/Robot"]
path = assets/syntaxes/Robot
url = https://github.com/andriyko/sublime-robot-framework-assistant.git
[submodule "assets/themes/sublime-snazzy"]
path = assets/themes/sublime-snazzy
url = https://github.com/greggb/sublime-snazzy
[submodule "assets/syntaxes/HTML (Twig)"]
path = assets/syntaxes/HTML (Twig)
url = https://github.com/Anomareh/PHP-Twig.tmbundle.git
[submodule "assets/syntaxes/AsciiDoc"]
path = assets/syntaxes/AsciiDoc
url = https://github.com/SublimeText/AsciiDoc.git
[submodule "assets/syntaxes/Assembly (ARM)"]
path = assets/syntaxes/Assembly (ARM)
url = https://github.com/tvi/Sublime-ARM-Assembly
[submodule "assets/syntaxes/syslog-syntax"]
path = assets/syntaxes/Syslog
url = https://github.com/caos21/syslog-syntax.git
branch = master
[submodule "assets/syntaxes/protobuf-syntax-highlighting"]
path = assets/syntaxes/Protobuf
url = https://github.com/VcamX/protobuf-syntax-highlighting.git
branch = master
[submodule "assets/syntaxes/Terraform"]
path = assets/syntaxes/Terraform
url = https://github.com/alexlouden/Terraform.tmLanguage.git
[submodule "assets/syntaxes/Jsonnet"]
path = assets/syntaxes/Jsonnet
url = https://github.com/gburiola/sublime-jsonnet-syntax.git
[submodule "assets/syntaxes/varlink"]
path = assets/syntaxes/varlink
url = https://github.com/varlink/syntax-highlight-varlink.git
[submodule "assets/syntaxes/sublime-fish"]
path = assets/syntaxes/sublime-fish
url = https://github.com/Phidica/sublime-fish.git
[submodule "assets/syntaxes/Org mode"]
path = assets/syntaxes/Org mode
url = https://github.com/jezcope/Org.tmbundle.git
[submodule "assets/syntaxes/requirementstxt"]
path = assets/syntaxes/requirementstxt
url = https://github.com/wuub/requirementstxt
[submodule "assets/syntaxes/DotENV"]
path = assets/syntaxes/DotENV
url = https://github.com/zaynali53/DotENV
[submodule "assets/syntaxes/hosts"]
path = assets/syntaxes/hosts
url = https://github.com/brandonwamboldt/sublime-hosts
[submodule "assets/syntaxes/ssh-config"]
path = assets/syntaxes/ssh-config
url = https://github.com/robballou/sublimetext-sshconfig.git
[submodule "assets/syntaxes/GraphQL"]
path = assets/syntaxes/GraphQL
url = https://github.com/dncrews/GraphQL-SublimeText3.git
[submodule "assets/syntaxes/Verilog"]
path = assets/syntaxes/Verilog
url = https://github.com/pro711/sublime-verilog
[submodule "assets/syntaxes/SCSS_Sass"]
path = assets/syntaxes/SCSS_Sass
url = https://github.com/braver/SublimeSass
[submodule "assets/syntaxes/Strace"]
path = assets/syntaxes/Strace
url = https://github.com/djuretic/SublimeStrace
+39 -19
View File
@@ -1,5 +1,5 @@
language: rust
cache: cargo
matrix:
include:
# Stable channel.
@@ -11,32 +11,50 @@ matrix:
env:
- TARGET=x86_64-unknown-linux-musl
- CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
- os: linux
rust: stable
env: TARGET=i686-unknown-linux-gnu
- os: osx
rust: stable
env: TARGET=x86_64-apple-darwin
- os: linux
rust: stable
env:
- TARGET=arm-unknown-linux-gnueabihf
- CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.8
- CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.8
- os: linux
rust: stable
env:
- TARGET=aarch64-unknown-linux-gnu
- CC_aarch64-unknown-linux-gnu=/usr/bin/aarch64-linux-gnu-gcc-4.8
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc-4.8
# Minimum Rust supported channel.
- os: linux
rust: 1.24.0
rust: 1.35.0
env: TARGET=x86_64-unknown-linux-gnu
- os: linux
rust: 1.24.0
rust: 1.35.0
env:
- TARGET=x86_64-unknown-linux-musl
- CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
- os: osx
rust: 1.24.0
rust: 1.35.0
env: TARGET=x86_64-apple-darwin
addons:
apt:
packages:
# needed for i686-unknown-linux-gnu target
- gcc-multilib
# needed for musl targets
- musl-tools
# needed to build deb packages
- fakeroot
# Code formatting check
- os: linux
rust: nightly
# skip the global install step
install:
- cargo install --debug --force rustfmt-nightly
script: cargo fmt -- --check
sudo: required
before_install:
- ci/before_install.bash
env:
global:
@@ -51,12 +69,7 @@ install:
- if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi
script:
# Incorporate TARGET env var to the build and test process
- cargo build --target $TARGET --verbose
- cargo test --target $TARGET --verbose
# Run 'bat' on its own source code and the README
- cargo run --target $TARGET -- src/main.rs
- cargo run --target $TARGET -- README.md
- ci/script.bash
before_deploy:
- bash ci/before_deploy.bash
@@ -90,3 +103,10 @@ deploy:
notifications:
email:
on_success: never
# Caching
cache:
directories:
- /home/travis/.cargo
before_cache:
- rm -rf /home/travis/.cargo/registry
Generated
+849 -440
View File
File diff suppressed because it is too large Load Diff
+33 -10
View File
@@ -7,27 +7,50 @@ license = "MIT/Apache-2.0"
name = "bat"
readme = "README.md"
repository = "https://github.com/sharkdp/bat"
version = "0.2.3"
version = "0.12.1"
exclude = [
"assets/syntaxes/*",
"assets/themes/*",
]
build = "build.rs"
edition = '2018'
[dependencies]
atty = "0.2.2"
ansi_term = "0.9"
console = "0.6"
error-chain = "0.11"
directories = "0.9"
lazy_static = "1.0"
atty = "0.2.13"
ansi_term = "^0.12.1"
ansi_colours = "^1.0"
console = "0.8"
dirs = "2.0"
lazy_static = "1.4"
wild = "2.0"
content_inspector = "0.2.4"
encoding = "0.2"
shell-words = "0.1.0"
[dependencies.git2]
version = "0.6"
version = "0.10"
default-features = false
features = []
[dependencies.syntect]
version = "2"
version = "3.2.1"
default-features = false
features = ["parsing", "yaml-load", "dump-load", "dump-create"]
[dependencies.clap]
version = "2"
version = "2.33"
default-features = false
features = ["suggestions", "color", "wrap_help"]
[dependencies.error-chain]
version = "0.12"
default-features = false
features = []
[dev-dependencies]
tempdir = "0.3"
assert_cmd = "0.11.1"
escargot = "0.5.0"
[build-dependencies]
clap = "2.33"
+2
View File
@@ -1,3 +1,5 @@
Copyright (c) 2018 bat-developers (https://github.com/sharkdp/bat).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
+515 -47
View File
@@ -1,83 +1,551 @@
# bat
<p align="center">
<img src="doc/logo-header.svg" alt="bat - a cat clone with wings"><br>
<a href="https://travis-ci.org/sharkdp/bat"><img src="https://travis-ci.org/sharkdp/bat.svg?branch=master" alt="Build Status"></a>
<a href="https://ci.appveyor.com/project/sharkdp/bat"><img src="https://ci.appveyor.com/api/projects/status/cptsmtbiwbnr2vhf?svg=true"></a>
<img src="https://img.shields.io/crates/l/bat.svg" alt="license">
<a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
A <i>cat(1)</i> clone with syntax highlighting and Git integration.
</p>
[![Build Status](https://travis-ci.org/sharkdp/bat.svg?branch=master)](https://travis-ci.org/sharkdp/bat)
[![Version info](https://img.shields.io/crates/v/bat.svg)](https://crates.io/crates/bat)
A *cat(1)* clone with syntax highlighting and Git integration.
## Features
<p align="center">
<a href="#syntax-highlighting">Key Features</a> •
<a href="#how-to-use">How To Use</a> •
<a href="#installation">Installation</a> •
<a href="#customization">Customization</a> •
<a href="#project-goals-and-alternatives">Project goals, alternatives</a> •
Translation [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="doc/README-ja.md">日本文</a>]
</p>
### Syntax highlighting
`bat` supports syntax highlighting for a large number of programming and markup languages:
`bat` supports syntax highlighting for a large number of programming and markup
languages:
![Syntax highlighting example](https://imgur.com/rGsdnDe.png)
### Git integration
`bat` communicates with `git` to show modifications with respect to the index (see left side bar):
`bat` communicates with `git` to show modifications with respect to the index
(see left side bar):
![Git integration example](https://i.imgur.com/2lSW4RE.png)
### Show non-printable characters
You can use the `-A`/`--show-all` option to show and highlight non-printable
characters:
![Non-printable character example](https://i.imgur.com/WndGp9H.png)
### Automatic paging
`bat` can pipe its own output to `less` if the output is too large for one screen.
### File concatenation
Oh.. you can also use it to concatenate files :wink:. Whenever
`bat` detects a non-interactive terminal (i.e. when you pipe into another process
or into a file), `bat` will act as a drop-in replacement for `cat` and
fall back to printing the plain file contents.
## How to use
Display a single file on the terminal
```bash
> bat README.md
```
Display multiple files at once
```bash
> bat src/*.rs
```
Read from stdin, determine the syntax automatically
```bash
> curl -s https://sh.rustup.rs | bat
```
Read from stdin, specify the language explicitly
```bash
> yaml2json .travis.yml | json_pp | bat -l json
```
Show and highlight non-printable characters:
```bash
> bat -A /etc/hosts
```
Use it as a `cat` replacement:
```bash
bat > note.md # quickly create a new file
bat header.md content.md footer.md > document.md
bat -n main.rs # show line numbers (only)
bat f - g # output 'f', then stdin, then 'g'.
```
### Integration with other tools
#### `find` or `fd`
You can use the `-exec` option of `find` to preview all search results with `bat`:
```bash
find … -exec bat {} +
```
If you happen to use [`fd`](https://github.com/sharkdp/fd), you can use the `-X`/`--exec-batch` option to do the same:
```bash
fd … -X bat
```
#### `tail -f`
`bat` can be combined with `tail -f` to continuously monitor a given file with syntax highlighting.
```bash
tail -f /var/log/pacman.log | bat --paging=never -l log
```
Note that we have to switch off paging in order for this to work. We have also specified the syntax
explicitly (`-l log`), as it can not be auto-detected in this case.
#### `git show`
You can combine `bat` with `git show` to view an older version of a given file with proper syntax
highlighting:
```bash
git show v0.6.0:src/main.rs | bat -l rs
```
#### `xclip`
The line numbers and Git modification markers in the output of `bat` can make it hard to copy
the contents of a file. To prevent this, you can call `bat` with the `-p`/`--plain` option or
simply pipe the output into `xclip`:
```bash
bat main.cpp | xclip
```
`bat` will detect that the output is being redirected and print the plain file contents.
#### `man`
`bat` can be used as a pager for `man`. It can be used like this:
```
export MANPAGER="sh -c 'col -b | bat -l man -p'"
man 2 select
```
The [Manpage syntax](assets/syntaxes/Manpage.sublime-syntax) is developed in this repository and still needs some work.
## Installation
[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions)
### On Ubuntu
*... and other Debian-based Linux distributions.*
Download the latest `.deb` package from the [release page](https://github.com/sharkdp/bat/releases)
and install it via:
``` bash
sudo dpkg -i bat_0.12.1_amd64.deb # adapt version number and architecture
```
### On Alpine Linux
You can install [the `bat` package](https://pkgs.alpinelinux.org/packages?name=bat)
from the official sources, provided you have the appropriate repository enabled:
```bash
apk add bat
```
### On Arch Linux
You can install [the `bat` package](https://www.archlinux.org/packages/community/x86_64/bat/)
from the official sources:
```bash
pacman -S bat
```
### On Fedora
You can install [the `bat` package](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506) from the official [Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/) repository.
```bash
dnf install bat
```
### On Gentoo Linux
You can install [the `bat` package](https://packages.gentoo.org/packages/sys-apps/bat)
from the official sources:
```bash
emerge sys-apps/bat
```
### On Void Linux
You can install `bat` via xbps-install:
```
xbps-install -S bat
```
### On FreeBSD
You can install a precompiled [`bat` package](https://www.freshports.org/textproc/bat) with pkg:
```bash
pkg install bat
```
or build it on your own from the FreeBSD ports:
```bash
cd /usr/ports/textproc/bat
make install
```
### Via nix
You can install `bat` using the [nix package manager](https://nixos.org/nix):
```bash
nix-env -i bat
```
### On openSUSE
You can install `bat` with zypper:
```
zypper install bat
```
### On macOS
You can install `bat` with [Homebrew](http://braumeister.org/formula/bat):
```bash
brew install bat
```
### On Windows
You can download prebuilt binaries from the [Release page](https://github.com/sharkdp/bat/releases),
or install it with [scoop](https://scoop.sh/) or [Chocolatey](https://chocolatey.org):
```bash
scoop install bat
```
```bash
choco install bat
```
[See below](#using-bat-on-windows) for notes.
### Via Docker
There is a [Docker image](https://hub.docker.com/r/danlynn/bat/) that you can use to run `bat` in a container:
```bash
docker pull danlynn/bat
alias bat='docker run -it --rm -e BAT_THEME -e BAT_STYLE -e BAT_TABS -v "$(pwd):/myapp" danlynn/bat'
```
### Via Ansible
You can install `bat` with [Ansible](https://www.ansible.com/):
```bash
# Install role on local machine
ansible-galaxy install aeimer.install_bat
```
```yaml
---
# Playbook to install bat
- host: all
roles:
- aeimer.install_bat
```
- [Ansible Galaxy](https://galaxy.ansible.com/aeimer/install_bat)
- [GitHub](https://github.com/aeimer/ansible-install-bat)
This should work with the following distributions:
- Debian/Ubuntu
- ARM (eg. Raspberry PI)
- Arch Linux
- Void Linux
- FreeBSD
- MacOS
### From binaries
Check out the [Release page](https://github.com/sharkdp/bat/releases) for binary builds and Debian packages.
### Arch Linux
On Arch Linux, you can install [the AUR package](https://aur.archlinux.org/packages/bat/) via yaourt, or manually:
```bash
git clone https://aur.archlinux.org/bat.git
cd bat
makepkg -si
```
Check out the [Release page](https://github.com/sharkdp/bat/releases) for
prebuilt versions of `bat` for many different architectures. Statically-linked
binaries are also available: look for archives with `musl` in the file name.
### From source
If you want to build to compile `bat` from source, you need Rust 1.24 or higher.
You can then use `cargo` to build everything:
If you want to build `bat` from source, you need Rust 1.35 or
higher. You can then use `cargo` to build everything:
``` bash
```bash
cargo install bat
```
You may have to install `cmake` and the `libz` development package
(`libz-dev` or `libz-devel`) in order for the build to succeed.
## Customization
`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/) library for syntax highlighting. `syntect` can read any [Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html) and theme.
### Highlighting theme
To build your own language-set and theme, follow these steps:
Create a folder with a syntax highlighting theme:
Use `bat --list-themes` to get a list of all available themes for syntax
highlighting. To select the `TwoDark` theme, call `bat` with the
`--theme=TwoDark` option or set the `BAT_THEME` environment variable to
`TwoDark`. Use `export BAT_THEME="TwoDark"` in your shell's startup file to
make the change permanent. Alternatively, use `bat`s
[configuration file](https://github.com/sharkdp/bat#configuration-file).
If you want to preview the different themes on a custom file, you can use
the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
``` bash
mkdir -p ~/.config/bat/themes
cd ~/.config/bat/themes
# Download a theme, for example:
git clone https://github.com/jonschlinkert/sublime-monokai-extended
# Create a 'Default.tmTheme' link
ln -s "sublime-monokai-extended/Monokai Extended.tmTheme" Default.tmTheme
bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
```
Create a folder with language definition files:
`bat` looks good on a dark background by default. However, if your terminal uses a
light background, some themes like `GitHub` or `OneHalfLight` will work better for you.
You can also use a custom theme by following the
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
``` bash
mkdir -p ~/.config/bat/syntax
cd ~/.config/bat/syntax
### Output style
# Download some language definition files, for example:
git clone https://github.com/sublimehq/Packages/
rm -rf Packages/Markdown
git clone https://github.com/jonschlinkert/sublime-markdown-extended
You can use the `--style` option to control the appearance of `bat`s output.
You can use `--style=numbers,changes`, for example, to show only Git changes
and line numbers but no grid and no file header. Set the `BAT_STYLE` environment
variable to make these changes permanent or use `bat`s
[configuration file](https://github.com/sharkdp/bat#configuration-file).
### Adding new syntaxes / language definitions
`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
library for syntax highlighting. `syntect` can read any
[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
and theme. To add new syntax definitions, do the following.
Create a folder with syntax definition files:
```bash
mkdir -p "$(bat --config-dir)/syntaxes"
cd "$(bat --config-dir)/syntaxes"
# Put new '.sublime-syntax' language definition files
# in this folder (or its subdirectories), for example:
git clone https://github.com/tellnobody1/sublime-purescript-syntax
```
Finally, use the following command to parse all these files into a binary
cache:
Now use the following command to parse these files into a binary cache:
``` bash
bat init-cache
```bash
bat cache --build
```
Finally, use `bat --list-languages` to check if the new languages are available.
If you ever want to go back to the default settings, call:
```bash
bat cache --clear
```
### Adding new themes
This works very similar to how we add new syntax definitions.
First, create a folder with the new syntax highlighting themes:
```bash
mkdir -p "$(bat --config-dir)/themes"
cd "$(bat --config-dir)/themes"
# Download a theme in '.tmTheme' format, for example:
git clone https://github.com/greggb/sublime-snazzy
# Update the binary cache
bat cache --build
```
Finally, use `bat --list-themes` to check if the new themes are available.
### Using a different pager
`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
set, `less` is used by default. If you want to use a different pager, you can either modify the
`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
`PAGER`.
If you want to pass command-line arguments to the pager, you can also set them via the
`PAGER`/`BAT_PAGER` variables:
```bash
export BAT_PAGER="less -RF"
```
Instead of using environment variables, you can also use `bat`s [configuration file](https://github.com/sharkdp/bat#configuration-file) to configure the pager (`--pager` option).
**Note**: By default, if the pager is set to `less` (and no command-line options are specified),
`bat` will pass the following command line
options to the pager: `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` and `-X`/`--no-init`.
The first (`-R`) is needed to interpret ANSI colors correctly. The second option (`-F`) instructs
less to exit immediately if the output size is smaller than the vertical size of the terminal.
This is convenient for small files because you do not have to press `q` to quit the pager. The
third option (`-X`) is needed to fix a bug with the `--quit-if-one-screen` feature in old versions
of `less`. Unfortunately, it also breaks mouse-wheel support in `less`. If you want to enable
mouse-wheel scrolling, you can either pass just `-R` (as in the example above, this will disable
the quit-if-one-screen feature), or you can use a recent version of `less` and pass `-RF` which
will hopefully enable both quit-if-one-screen and mouse-wheel scrolling.
If scrolling still doesn't work for you, you can try to pass the `-S` option in addition.
## Configuration file
`bat` can also be customized with a configuration file. The location of the file is dependent
on your operating system. To get the default path for your system, call
```
bat --config-file
```
Alternatively, you can use the `BAT_CONFIG_PATH` environment variable to point `bat` to a
non-default location of the configuration file:
```bash
export BAT_CONFIG_PATH="/path/to/bat.conf"
```
### Format
The configuration file is a simple list of command line arguments. Use `bat --help` to see a full list of possible options and values. In addition, you can add comments by prepending a line with the `#` character.
Example configuration file:
```bash
# Set the theme to "TwoDark"
--theme="TwoDark"
# Show line numbers, Git modifications and file header (but no grid)
--style="numbers,changes,header"
# Use italic text on the terminal (not supported on all terminals)
--italic-text=always
# Add mouse scrolling support in less (does not work with older
# versions of "less")
--pager="less -FR"
# Use C++ syntax (instead of C) for .h header files
--map-syntax h:cpp
# Use "gitignore" highlighting for ".ignore" files
--map-syntax .ignore:.gitignore
```
## Using `bat` on Windows
`bat` mostly works out-of-the-box on Windows, but a few features may need extra configuration.
### Paging
Windows only includes a very limited pager in the form of `more`. You can download a Windows binary
for `less` [from its homepage](http://www.greenwoodsoftware.com/less/download.html) or [through
Chocolatey](https://chocolatey.org/packages/Less). To use it, place the binary in a directory in
your `PATH` or [define an environment variable](#using-a-different-pager). The [Chocolatey package](#on-windows) installs `less` automatically.
### Colors
Windows 10 natively supports colors in both `conhost.exe` (Command Prompt) and PowerShell since
[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as
well as in newer versions of bash. On earlier versions of Windows, you can use
[Cmder](http://cmder.net/), which includes [ConEmu](https://conemu.github.io/).
**Note:** The Git and MSYS versions of `less` do not correctly interpret colors on Windows. If you
dont have any other pagers installed, you can disable paging entirely by passing `--paging=never`
or by setting `BAT_PAGER` to an empty string.
### Cygwin
`bat` on Windows does not natively support Cygwin's unix-style paths (`/cygdrive/*`). When passed an absolute cygwin path as an argument, `bat` will encounter the following error: `The system cannot find the path specified. (os error 3)`
This can be solved by creating a wrapper or adding the following function to your `.bash_profile` file:
```shell
bat() {
local index
local args=("$@")
for index in $(seq 0 ${#args[@]}) ; do
case "${args[index]}" in
-*) continue;;
*) [ -e "${args[index]}" ] && args[index]="$(cygpath --windows "${args[index]}")";;
esac
done
command bat "${args[@]}"
}
```
## Troubleshooting
### Terminals & colors
`bat` handles terminals *with* and *without* truecolor support. However, the colors in the syntax
highlighting themes are not optimized for 8-bit colors and it is therefore strongly recommended
that you use a terminal with 24-bit truecolor support (`terminator`, `konsole`, `iTerm2`, ...).
See [this article](https://gist.github.com/XVilka/8346728) for more details and a full list of
terminals with truecolor support.
Make sure that your truecolor terminal sets the `COLORTERM` variable to either `truecolor` or
`24bit`. Otherwise, `bat` will not be able to determine whether or not 24-bit escape sequences
are supported (and fall back to 8-bit colors).
### Line numbers and grid are hardly visible
Please try a different theme (see `bat --list-themes` for a list). The `OneHalfDark` and
`OneHalfLight` themes provide grid and line colors that are brighter.
## Development
```bash
# Recursive clone to retrieve all submodules
git clone --recursive https://github.com/sharkdp/bat
# Build (debug version)
cd bat
cargo build
# Run unit tests and integration tests
cargo test
# Install (release version)
cargo install
# Build a bat binary with modified syntaxes and themes
bash assets/create.sh
cargo install -f
```
## Project goals and alternatives
`bat` tries to achieve the following goals:
- Provide beautiful, advanced syntax highlighting
- Integrate with Git to show file modifications
- Be a drop-in replacement for (POSIX) `cat`
- Offer a user-friendly command-line interface
There are a lot of alternatives, if you are looking for similar programs. See
[this document](doc/alternatives.md) for a comparison.
+49
View File
@@ -0,0 +1,49 @@
environment:
global:
TARGET: x86_64-pc-windows-msvc
RUST_VERSION: stable
CRATE_NAME: bat
CARGO_HOME: "c:\\cargo"
RUSTUP_HOME: "c:\\rustup"
install:
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init.exe -y --default-host %TARGET%
- set PATH=%PATH%;C:\cargo\bin
- rustc -Vv
- cargo -V
build: false
test_script:
- cargo test --target %TARGET% --verbose
- cargo run --target %TARGET% -- src/main.rs README.md --paging=never
before_deploy:
# Generate artifacts for release
- cargo build --release --verbose
- ps: ci\before_deploy.ps1
deploy:
description: 'Automatically deployed release'
artifact: /.*\.zip/
# Here's how:
# - Go to 'https://github.com/settings/tokens/new' and generate a Token with only the
# `public_repo` scope enabled
# - Then go to 'https://ci.appveyor.com/tools/encrypt' and enter the newly generated token.
# - Enter the "encrypted value" below
auth_token:
secure: oO4/J+hcFXgXcEqEc8gzlQNqLG0IxU78s4EyH+uczGdsyWajb3yipxPR6nXUvmoj
provider: GitHub
on:
RUST_VERSION: stable
appveyor_repo_tag: true
cache:
- C:\Users\appveyor\.cargo\registry
- target
notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false
+1
View File
@@ -0,0 +1 @@
* linguist-vendored
+2
View File
@@ -0,0 +1,2 @@
syntaxes/*
themes/*
+13
View File
@@ -0,0 +1,13 @@
diff --git syntaxes/Packages/Java/JavaDoc.sublime-syntax syntaxes/Packages/Java/JavaDoc.sublime-syntax
index 422a6a9..40a741e 100644
--- syntaxes/Packages/Java/JavaDoc.sublime-syntax
+++ syntaxes/Packages/Java/JavaDoc.sublime-syntax
@@ -13,7 +13,7 @@ variables:
contexts:
prototype:
# https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#leadingasterisks
- - match: ^\s*(\*)\s*(?!\s*@)
+ - match: ^\s*(\*)(?!/)\s*(?!\s*@)
captures:
1: punctuation.definition.comment.javadoc
+40
View File
@@ -0,0 +1,40 @@
## Syntax Highlighting in bat
`bat` uses the [syntect](https://github.com/trishume/syntect) library to highlight source
code. As a basis, syntect uses [Sublime Text](https://www.sublimetext.com/) syntax definitions
in the `.sublime-syntax` format.
In order to add new syntaxes to `bat`, follow these steps:
1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
which can be included as a submodule (under `assets/syntaxes`).
2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
*New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
3. Run the `create.sh` script. It calls `bat cache --build` to parse all available
`.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
`bat` binary.
5. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
file. A new binary cache file will be created once before every new release of `bat`.
### Troubleshooting
Make sure that the local cache does not interfere with the internally stored syntaxes and
themes (`bat cache --clear`).
### Manual modifications
The following files have been manually modified after converting from a `.tmLanguage` file:
* `Dart.sublime-syntax` => removed `#regex.dart` include.
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types.
* `Org mode.sublime-syntax` => removed `task` file type.
### Non-submodule additions
* `Assembly (x86_64)` has been manually added from https://github.com/13xforever/x86-assembly-textmate-bundle due to `git clone` recursion problems
+76
View File
@@ -0,0 +1,76 @@
# Fish Shell Completions
# Place or symlink to $XDG_CONFIG_HOME/fish/completions/bat.fish ($XDG_CONFIG_HOME is usually set to ~/.config)
# Helper function:
function __bat_autocomplete_languages --description "A helper function used by "(status filename)
bat --list-languages | awk -F':' '
{
lang=$1
split($2, exts, ",")
for (i in exts) {
ext=exts[i]
if (ext !~ /[A-Z].*/ && ext !~ /^\..*rc$/) {
print ext"\t"lang
}
}
}
' | sort
end
# Completions:
complete -c bat -l color -xka "auto never always" -d "Specify when to use colored output (default: auto)" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l config-dir -d "Display location of 'bat' configuration directory" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l config-file -d "Display location of 'bat' configuration file" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l decorations -xka "auto never always" -d "Specify when to use the decorations specified with '--style' (default: auto)" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s h -l help -d "Print help message" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s H -l highlight-line -x -d "<N> Highlight the N-th line with a different background color" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l italic-text -xka "always never" -d "Specify when to use ANSI sequences for italic text (default: never)" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s l -l language -d "Set the language for syntax highlighting" -n "not __fish_seen_subcommand_from cache" -xa "(__bat_autocomplete_languages)"
complete -c bat -s r -l line-range -x -d "<N:M> Only print the specified range of lines for each file" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l list-languages -d "Display list of supported languages for syntax highlighting" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l list-themes -d "Display a list of supported themes for syntax highlighting" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s m -l map-syntax -x -d "<from:to> Map a file extension or file name to an existing syntax" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s n -l number -d "Only show line numbers, no other decorations. Alias for '--style=numbers'" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l pager -x -d "<command> Specify which pager program to use (default: less)" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l paging -xka "auto never always" -d "Specify when to use the pager (default: auto)" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s p -l plain -d "Only show plain style, no decorations. Alias for '--style=plain'" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s A -l show-all -d "Show non-printable characters like space/tab/newline" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l style -xka "auto full plain changes header grid numbers" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l tabs -x -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l terminal-width -x -d "<width> Explicitly set terminal width; Prefix with '+' or '-' to offset (default width is auto determined)" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l theme -xka "(bat --list-themes | cat)" -d "Set the theme for syntax highlighting" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s u -l unbuffered -d "POSIX-compliant unbuffered output. Option is ignored" -n "not __fish_seen_subcommand_from cache"
complete -c bat -s V -l version -d "Show version information" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l wrap -xka "auto never character" -d "<mode> Specify the text-wrapping mode (default: auto)" -n "not __fish_seen_subcommand_from cache"
# Sub-command 'cache' completions
complete -c bat -a "cache" -d "Modify the syntax/language definition cache" -n "not __fish_seen_subcommand_from cache"
complete -c bat -l build -f -d "Parse syntaxes/language definitions into cache" -n "__fish_seen_subcommand_from cache"
complete -c bat -l clear -f -d "Reset syntaxes/language definitions to default settings" -n "__fish_seen_subcommand_from cache"
Vendored Regular → Executable
+12 -22
View File
@@ -1,27 +1,17 @@
set -e
#!/bin/bash
set -euo pipefail
THEME_FOLDER="$HOME/.config/bat/themes"
SYNTAX_FOLDER="$HOME/.config/bat/syntax"
ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -e "$THEME_FOLDER" ]; then
mkdir -p "$THEME_FOLDER"
(
cd "$THEME_FOLDER"
git clone https://github.com/jonschlinkert/sublime-monokai-extended
ln -s "sublime-monokai-extended/Monokai Extended.tmTheme" Default.tmTheme
)
fi
# Always remove the local cache to avoid any confusion
bat cache --clear
if [ ! -e "$SYNTAX_FOLDER" ]; then
mkdir -p "$SYNTAX_FOLDER"
(
cd "$SYNTAX_FOLDER"
git clone https://github.com/sublimehq/Packages/
rm -rf Packages/Markdown
git clone https://github.com/jonschlinkert/sublime-markdown-extended
)
fi
# TODO: Remove this (and the reverse part below) when
# https://github.com/trishume/syntect/issues/222 has been fixed
JAVADOC_FILE="${ASSET_DIR}/syntaxes/Packages/Java/JavaDoc.sublime-syntax"
JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch"
patch "$JAVADOC_FILE" "$JAVADOC_PATCH"
bat init-cache
bat cache --build --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
cp "$HOME/.cache/bat"/* .
patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Vendored Submodule
+1
Submodule assets/syntaxes/AWK added at 1ce5f90d44
Vendored Submodule
+1
+283
View File
@@ -0,0 +1,283 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: AsciiDoc
comment: |
A very early hack. Mostly ripped from other syntaxes.
Only the very basic stuff is working.
file_extensions:
- adoc
- asciidoc
- asc
scope: text.html.asciidoc
contexts:
main:
- include: heading_inline
- include: heading-block
- include: heading-blockattr
- match: \$\$(?!\$)
push:
- meta_scope: comment.block.passthrough.macro.doubledollar.asciidoc
- match: \$\$(?!\$)
pop: true
- match: \+\+\+(?!\+)
push:
- meta_scope: comment.block.passthrough.macro.tripeplus.asciidoc
- match: \+\+\+(?!\+)
pop: true
- match: (//).*$\n?
scope: comment.line.double-slash.asciidoc
- match: |-
(?x)^
(?= ([/+-.*_=]{4,})\s*$
| ([ \t]{1,})
| [=]{1,6}\s*+
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
)
push:
- meta_scope: meta.block-level.asciidoc
- match: |-
(?x)^
(?! \1
| ([ \t]{1,})
| [=]{1,6}\s*+
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
)
pop: true
- include: block_quote
- include: block_raw
- include: heading_inline
- include: heading-block
- include: separator
- match: '^[ ]{0,3}([*+-])(?=\s)'
captures:
1: punctuation.definition.list_item.asciidoc
push:
- meta_scope: markup.list.unnumbered.asciidoc
- match: ^(?=\S)
captures:
1: punctuation.definition.list_item.asciidoc
pop: true
- include: list-paragraph
- match: '^[ ]{0,3}[0-9]+(\.)(?=\s)'
captures:
1: punctuation.definition.list_item.asciidoc
push:
- meta_scope: markup.list.numbered.asciidoc
- match: ^(?=\S)
captures:
1: punctuation.definition.list_item.asciidoc
pop: true
- include: list-paragraph
- match: '^([/+-.*_=]){4,}\s*$'
push:
- meta_scope: comment.block.asciidoc
- match: '^\1{4,}\s*$'
pop: true
- match: '^([/+.]){4,}\s*$'
comment: asciidoc formatting is disabled inside certain blocks.
push:
- meta_scope: meta.disable-asciidoc
- match: '^[/+.]{4,}\s*$'
pop: true
- match: '^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+)'
push:
- meta_scope: meta.paragraph.asciidoc
- match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n'
pop: true
- include: inline
- include: scope:text.html.basic
- match: '^(={3,})(?=[ \t]*$)'
scope: markup.heading.0.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
- match: '^(-{3,})(?=[ \t]*$)'
scope: markup.heading.1.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
- match: '^(~{3,})(?=[ \t]*$)'
scope: markup.heading.2.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
- match: '^(\^{3,})(?=[ \t]*$)'
scope: markup.heading.3.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
- match: '^(\+{3,})(?=[ \t]*$)'
scope: markup.heading.4.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
attribute-entry:
- match: '^:[-_. A-Za-z0-9]+:\s*(.*)\s*$'
scope: variable.other
attribute-reference:
- match: "{[-_. A-Za-z0-9]+}"
scope: variable.other
attribute-reference-predefined:
- match: "{(?i:amp|asciidoc-dir|asciidoc-file|asciidoc-version|author|authored|authorinitials|backend-docbook|backend-xhtml11|backend-html4|docbook-article|xhtml11-article|html4-article|docbook-book|xhtml11-book|html4-book|docbook-manpage|xhtml11-manpage|html4-manpage|backend|backslash|basebackend|brvbar|date|docdate|doctime|docname|docfile|docdir|doctitle|doctype-article|doctype-book|doctype-manpage|doctype|email|empty|encoding|filetype|firstname|gt|id|indir|infile|lastname|level|listindex|localdate|localtime|lt|manname|manpurpose|mantitle|manvolnum|middlename|nbsp|outdir|outfile|reftext|revision|sectnum|showcomments|title|two_colons|two_semicolons|user-dir|verbose)}"
scope: support.variable
block_quote:
- match: '^([/+-.*_=]){4,}\s*$'
push:
- meta_scope: comment.block.asciidoc
- match: '^\1{4,}\s*$'
pop: true
block_raw:
- match: '\G([ ]{4}|\t).*$\n?'
scope: markup.raw.block.asciidoc
bracket:
- match: '<(?![a-z/?\$!])'
comment: |
asciidoc will convert this for us. We match it so that the
HTML grammar will not mark it up as invalid.
scope: meta.other.valid-bracket.asciidoc
character-replacements:
- match: \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<=
scope: constant.character.asciidoc
escape:
- match: '\\[-`*_#+.!(){}\[\]\\>:]'
scope: constant.character.escape.asciidoc
heading:
- match: '(?m)^(\S+)$([=-~^+])+\s*$'
scope: markup.heading.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
heading-block:
- match: ^\.(\w.*)$
scope: markup.heading.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
heading-blockattr:
- match: '^\[\[?(\w.*)\]$'
scope: markup.heading.asciidoc
captures:
1: punctuation.definition.heading.asciidoc
heading_inline:
- match: '\G(={1,6})(?!=)\s*(?=\S)'
captures:
1: punctuation.definition.heading.asciidoc
push:
- meta_scope: markup.heading.asciidoc
- meta_content_scope: entity.name.section.asciidoc
- match: \s*(=*)$\n?
captures:
1: punctuation.definition.heading.asciidoc
pop: true
- include: inline
inline:
- include: line-break
- include: line-page-break
- include: line-ruler
- include: escape
- include: passthrough-macro-trippleplus-inline
- include: passthrough-macro-doubledollar-inline
- include: character-replacements
- include: bracket
- include: raw
- include: text-quote-single
- include: text-quote-double
- include: text-quote-other
- include: text-bold-unconstrained
- include: text-italic-unconstrained
- include: text-monospace-unconstrained
- include: text-unquoted-unconstrained
- include: text-bold
- include: text-italic
- include: text-monospace
- include: text-unquoted
- include: attribute-entry
- include: attribute-reference-predefined
- include: attribute-reference
line-break:
- match: (?<=\S)\s+\+$
scope: constant.character.escape.asciidoc
line-page-break:
- match: "^<{3,}$"
scope: constant.character.escape.asciidoc
line-ruler:
- match: "^'{3,}$"
scope: constant.character.escape.asciidoc
list-paragraph:
- match: \G\s+(?=\S)
push:
- meta_scope: meta.paragraph.list.asciidoc
- match: ^\s*$
pop: true
- include: inline
passthrough-macro-doubledollar-inline:
- match: '(?:\[.*\])?\$\$(?!\$).+\$\$(?!\$)'
scope: comment.block.passthrough.asciidoc
passthrough-macro-trippleplus-inline:
- match: '(?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+)'
scope: comment.block.passthrough.asciidoc
raw:
- match: '(`+)(?:[^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
scope: markup.raw.inline.asciidoc
captures:
1: punctuation.definition.raw.asciidoc
2: punctuation.definition.raw.asciidoc
separator:
- match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?'
scope: meta.separator.asciidoc
text-bold:
- match: (?<!\w)(\*)(?=\S)
captures:
1: punctuation.definition.bold.asciidoc
push:
- meta_scope: markup.bold.asciidoc
- match: (?<=\S)(\1)(?!\w)
captures:
1: punctuation.definition.bold.asciidoc
pop: true
text-bold-unconstrained:
- match: (\*\*)(?=\S)
captures:
1: punctuation.definition.bold.asciidoc
push:
- meta_scope: markup.bold.asciidoc
- match: (?<=\S)(\1)
captures:
1: punctuation.definition.bold.asciidoc
pop: true
text-italic:
- match: (?<!\w)('|_)(?=\S)
captures:
1: punctuation.definition.italic.asciidoc
push:
- meta_scope: markup.italic.asciidoc
- match: (?<=\S)(\1)((?!\1)|(?=\1\1))(?!\w)
captures:
1: punctuation.definition.italic.asciidoc
pop: true
text-italic-unconstrained:
- match: (__)(?=\S)
captures:
1: punctuation.definition.italic.asciidoc
push:
- meta_scope: markup.italic.asciidoc
- match: (?<=\S)(\1)
captures:
1: punctuation.definition.italic.asciidoc
pop: true
text-monospace:
- match: '(?<!\w)([\+`])[^\+]*(\1)(?!\w)'
scope: string.interpolated.asciidoc
text-monospace-unconstrained:
- match: (\+\+).*(\1)
scope: string.interpolated.asciidoc
text-quote-double:
- match: '(?<!\w)(?:\[.*\])?``(?!`).*''''(?!'')(?!\w)'
scope: string.quoted.double.asciidoc
text-quote-other:
- match: '(?<!\w)(?:\[.*\])?([~^]).*(\1)(?!\w)'
scope: string.quoted.single.asciidoc
text-quote-single:
- match: '(?<!\w)(?:\[.*\])?`(?!`).*''(?!'')(?!\w)'
comment: "TODO: Sub- and Superscript are really unconstrained"
scope: string.quoted.single.asciidoc
text-unquoted:
- match: (?<!\w)(#).*(\1)(?!\w)
scope: string.unquoted.asciidoc
text-unquoted-unconstrained:
- match: (##).*(\1)
scope: string.unquoted.asciidoc
+172
View File
@@ -0,0 +1,172 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: ARM Assembly
file_extensions:
- s
- S
scope: source.asm.arm
contexts:
main:
- match: "@.*$"
scope: comment.line
- match: //.*$
scope: comment.line
- match: ;.*$
scope: comment.line
- match: ^\s*\#\s*if\s+0\b
push:
- meta_scope: comment.preprocessor
- match: ^\s*\#\s*endif\b
pop: true
- match: /\*
push:
- meta_scope: comment.block
- match: \*/
pop: true
- match: |-
(?x)
^\s*\#\s*(define)\s+ # define
((?<id>[a-zA-Z_][a-zA-Z0-9_]*)) # macro name
(?: # and optionally:
(\() # an open parenthesis
(
\s* \g<id> \s* # first argument
((,) \s* \g<id> \s*)* # additional arguments
(?:\.\.\.)? # varargs ellipsis?
)
(\)) # a close parenthesis
)?
captures:
1: keyword.control.import.define.c
2: entity.name.function.preprocessor.c
4: punctuation.definition.parameters.c
5: variable.parameter.preprocessor.c
7: punctuation.separator.parameters.c
8: punctuation.definition.parameters.c
push:
- meta_scope: meta.preprocessor.macro.c
- match: (?=(?://|/\*))|$
pop: true
- match: (?>\\\s*\n)
scope: punctuation.separator.continuation.c
- include: $top_level_main
- match: ^\s*#\s*(error|warning)\b
captures:
1: keyword.control.import.error.c
push:
- meta_scope: meta.preprocessor.diagnostic.c
- match: $
captures:
1: keyword.control.import.error.c
pop: true
- match: (?>\\\s*\n)
scope: punctuation.separator.continuation.c
- match: ^\s*#\s*(include|import)\b\s+
captures:
1: keyword.control.import.include.c
push:
- meta_scope: meta.preprocessor.c.include
- match: (?=(?://|/\*))|$
captures:
1: keyword.control.import.include.c
pop: true
- match: (?>\\\s*\n)
scope: punctuation.separator.continuation.c
- match: '"'
captures:
0: punctuation.definition.string.begin.c
push:
- meta_scope: string.quoted.double.include.c
- match: '"'
captures:
0: punctuation.definition.string.end.c
pop: true
- match: <
captures:
0: punctuation.definition.string.begin.c
push:
- meta_scope: string.quoted.other.lt-gt.include.c
- match: ">"
captures:
0: punctuation.definition.string.end.c
pop: true
- match: '((?i)([xw][0-9]|[xw]1[0-9]||[xw]2[0-9]|[wx]30|wzr|xzr|wsp|fpsr|fpcr|[rcp]1[0-5]|[rcp][0-9]|a[1-4]|v[1-8]|sl|sb|fp|ip|sp|lr|(c|s)psr(_c)?|pc|[sd]3[0-1]|[sd][12][0-9]|[sd][0-9]|fpsid|fpscr|fpexc|q3[0-1]|q2[0-9]|q1[0-9]|q[0-9]|APSR_nzcv|sy)!?(?-i))?\b'
scope: storage.other.register
- match: \.(?i)(globl|global|macro|endm|purgem|if|elseif|else|endif|section|text|arm|align|balign|irp|rept|endr|req|unreq|error|short|func|endfunc|hidden|type|fpu|arch|code|altmacro|object_arch|word|int|string)(?-i)\b
scope: keyword.control.directive
- match: armv(2a?|3m?|4t?|5t?e?6(j|t2|zk?|-m)?|7v?e?(-(a|r|m))?|8-a(\+crc)?)
scope: keyword.control.arch.arm
- match: ^\s*#\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef|endif)\b
captures:
1: keyword.control.import.c
push:
- meta_scope: meta.preprocessor.c
- match: (?=(?://|/\*))|$
captures:
1: keyword.control.import.c
pop: true
- match: (?>\\\s*\n)
scope: punctuation.separator.continuation.c
- match: |-
(?x)\b((?i)
(
(bf(c|i)|(u|s)bfx|(u|s)xta?(h|b)?) |
(v(add|cvt|sub|mov|trn|cmp|div|qdmulh|mrs|mul|ld1|qadd|qshrun|st[1234]|addw|mull|mlal|rshrn|swp|qmovun)|qmovun)(\.([isup]?8|[isupf]?16|[isuf]?32|[isu]?64))* |
(and|m(rs|sr)|eor|sub|rsb|add|adc|sbc|rsc|tst|teq|cmp|cmn|orr|mov|bic|mvn |
(neg) |
(lsr|lsl|ror|asr) # shift ops either pseudo ops or actual shifts
)s? |
(mul|mla|mull|smlabb) |
(mov(w|t)) |
rev(8|16)? |
(pld|adr|adrl|vswp)
)
(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
scope: support.function.mnemonic.arithmetic
- match: |-
(?x)\b((?i)(
swi|svc|wfi|
dmb | clrex | dsb | isb |
v(ldr|str|push|pop) |
(push|pop) |
(st|ld)(
p |
r(ex|s?(h|b)|d)? |
m(
(f|e)(d|a) |
(d|i)(b|a)
)?
) |
b(l|x|lx|lr|r)? |
(i|e)?ret|
b\.(eq|ne|hs|cs|lo|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|nv)+ |
(c|t)?bn?z|
)+(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))\b
scope: support.function.mnemonic.memory
- match: '\b((?i)(def(b|w|s)|equ|(include|get)(\s+([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*?)\.s)?)?(?-i))\b'
scope: meta.preprocessor.c.include
- match: \b((?i)(align)(?-i))?\b
scope: storage.type.c.memaccess
- match: \s+\".+\"
scope: string
- match: \b((?i)nop(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
scope: comment.nop
- match: '\s\['
push:
- meta_scope: storage.type.c.memaccess
- match: '\]'
pop: true
- match: (?>\\\s*\n)
scope: punctuation.separator.continuation.c
- include: $top_level_main
- match: (\b|\s+)\=\b
scope: keyword.control.evaluation
- match: '(\b|\s+)(\#)?-?(0x|&)[0-9a-fA-F_]+\b'
scope: constant.numeric.hex
- match: '(\b|\s+)\#-?[0-9a-zA-Z_]+\b'
scope: constant.numeric.literal
- match: '(\b|\s+)[0-9]+\b'
scope: constant.numeric.dec
- match: '\b([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*)\b'
scope: meta.function.source.arm.label
File diff suppressed because it is too large Load Diff
Vendored Submodule
+1
Submodule assets/syntaxes/CMake added at aba96a0862
Vendored Submodule
+1
Submodule assets/syntaxes/CSV added at 4786d037a7
+46
View File
@@ -0,0 +1,46 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Advanced CSV
file_extensions:
- csv
- tsv
scope: text.advanced_csv
contexts:
main:
- match: (\")
captures:
1: string.quoted.double.advanced_csv
push:
- meta_scope: meta.quoted.advanced_csv
- match: (\")
captures:
1: string.quoted.double.advanced_csv
pop: true
- include: main
- match: '(\[([+-]?\d*)(\:)?([+-]?\d*)(\,)?([+-]?\d*)(\:)?([+-]?\d*)\])?\s*([<>v^])?\s*(=)'
captures:
1: keyword.operator.advanced_csv
2: constant.numeric.formula.advanced_csv
4: constant.numeric.formula.advanced_csv
6: constant.numeric.formula.advanced_csv
8: constant.numeric.formula.advanced_csv
9: keyword.operator.advanced_csv
10: keyword.operator.advanced_csv
push:
- meta_scope: meta.range.advanced_csv
- match: (?=(\")|$)
pop: true
- include: scope:source.python
- match: '(?<=^|,|\s|\")([0-9.eE+-]+)(?=$|,|\s|\")'
scope: meta.number.advanced_csv
captures:
1: constant.numeric.advanced_csv
- match: '(?<=^|,|\s|\")([^, \t\"]+)(?=$|,|\s|\")'
scope: meta.nonnumber.advanced_csv
captures:
1: storage.type.advanced_csv
- match: (\,)
scope: meta.delimiter.advanced_csv
captures:
1: keyword.operator.advanced_csv
Vendored Submodule
+1
Submodule assets/syntaxes/Cabal added at 1c054d9b36
+47
View File
@@ -0,0 +1,47 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Cabal
file_extensions:
- cabal
scope: source.cabal
contexts:
main:
- match: ^(\s*)(exposed-modules):$
captures:
2: constant.other.cabal
push:
- meta_scope: exposed.modules.cabal
- match: ^(?!\1\s)
pop: true
- include: module_name
- match: ^(\s*)(build-depends):$
captures:
2: constant.other.cabal
push:
- meta_scope: exposed.modules.cabal
- match: ^(?!\1\s)
pop: true
- match: "([<>=]+)|([&|]+)"
scope: keyword.operator.haskell
- match: ((\d+|\*)\.)*(\d+|\*)
scope: constant.numeric.haskell
- match: '([\w\-]+)'
scope: support.function.haskell
- match: '^\s*([a-zA-Z_-]+)(:)\s+'
scope: entity.cabal
captures:
1: constant.other.cabal
2: punctuation.entity.cabal
- match: '^(?i)(executable|library|test-suite|benchmark|flag|source-repository)\s+([^\s,]+)\s*$'
scope: entity.cabal
captures:
1: keyword.entity.cabal
2: string.cabal
- match: ^(?i)library\s*$
scope: keyword.entity.cabal
- match: "--.*$"
scope: comment.cabal
module_name:
- match: '([A-Z][A-Za-z_''0-9]*)(\.[A-Z][A-Za-z_''0-9]*)*'
scope: storage.module.haskell
Vendored Submodule
+1
Submodule assets/syntaxes/Crystal added at 2f96cec2ca
File diff suppressed because it is too large Load Diff
Vendored Submodule
+1
Submodule assets/syntaxes/Dart added at d891fb36c9
+369
View File
@@ -0,0 +1,369 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Dart
file_extensions:
- dart
scope: source.dart
contexts:
main:
- match: ^(#!.*)$
scope: meta.preprocessor.script.dart
- match: ^\s*\b(library|import|export|part of|part)\b
captures:
0: keyword.other.import.dart
push:
- meta_scope: meta.declaration.dart
- match: ;
captures:
0: punctuation.terminator.dart
pop: true
- include: strings
- match: \b(as|show|hide|deferred)\b
scope: keyword.other.import.dart
- include: comments
- include: constants-and-special-vars
- include: annotations
- include: decl-typedef
- include: decl-class
- include: decl-enum
- include: decl-function
- include: keywords
- include: strings
annotations:
- match: '^(?:\s*)((@)([a-zA-Z0-9_]+))'
captures:
1: annotation.dart
2: entity.name.function.annotation.dart
3: support.type.dart
comments:
- match: /\*\*/
scope: comment.block.empty.dart
captures:
0: punctuation.definition.comment.dart
- include: comments-inline
comments-inline:
- match: /\*
push:
- meta_scope: comment.block.dart
- match: \*/
pop: true
- include: scope:text.dart-doccomments
- match: (///)
captures:
1: marker.dart
push:
- meta_scope: comment.line.triple-slash.dart
- match: $
pop: true
- include: scope:text.dart-doccomments
- match: (//)
captures:
1: marker.dart
push:
- meta_scope: comment.line.double-slash.dart
- match: $
pop: true
- include: scope:text.dart-doccomments
constants-and-special-vars:
- match: \b(true|false|null)\b
scope: constant.language.dart
- match: \b(this|super)\b
scope: variable.language.dart
- match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b'
scope: constant.numeric.dart
decl-class:
- match: \bclass\b
captures:
0: keyword.control.new.dart
push:
- meta_scope: meta.declaration.class.dart
- match: "(?={)"
pop: true
- include: keywords
- match: "[A-Za-z_][A-Za-z0-9_]*"
scope: class.name.dart
decl-enum:
- match: \benum\b
captures:
0: keyword.declaration.dart
push:
- meta_scope: meta.declaration.enum.dart
- match: "(?={)"
pop: true
- include: keywords
- match: "[A-Za-z_][A-Za-z0-9_]*"
scope: enum.name.dart
decl-function:
- match: ^\s*(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(get)\s+(\w+)\s+(?==>)
comment: A getter with a primitive return type.
scope: meta.declaration.function.dart
captures:
1: storage.type.primitive.dart
2: keyword.declaration.dart
3: function.name.dart
- match: ^\s*(?:\b(\w+)\b\s+)?(get)\s+(\w+)\s+(?==>)
comment: A getter with a user-defined return type or no return type.
scope: meta.declaration.function.dart
captures:
1: type.user-defined.dart
2: keyword.declaration.dart
3: function.name.dart
- match: ^\s*(set)\s+(\w+)(?=\()
comment: A setter.
captures:
1: keyword.declaration.dart
2: function.name.dart
push:
- meta_scope: meta.declaration.function.dart
- match: \)
pop: true
- include: comments-inline
- include: decl-function-parameter
- include: strings
- include: keywords
- match: ^\s*(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(\w+)(?=\()
comment: A function with a primitive return type.
captures:
1: storage.type.primitive.dart
2: function.name.dart
push:
- meta_scope: meta.declaration.function.dart
- match: \)
pop: true
- include: comments-inline
- include: decl-function-parameter
- include: strings
- include: keywords
- match: ^\s*(?:\b(return)\b)\s+(\w+)(?=\()
comment: A function invocation after 'return'
captures:
1: keyword.control.dart
2: function.name.dart
push:
- meta_scope: meta.invocation.function.dart
- match: \)
pop: true
- include: comments-inline
- include: decl-function-parameter
- include: strings
- include: keywords
- match: ^\s*\b(new)\b\s+(\w+)(?=\()
comment: A class instantiation after 'new'
captures:
1: keyword.declaration.dart
2: function.name.dart
push:
- meta_scope: meta.invocation.function.dart
- match: \)
pop: true
- include: comments-inline
- include: decl-function-parameter
- include: strings
- include: keywords
decl-function-parameter:
- include: constants-and-special-vars
- match: (?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(\w+)(?=\()
comment: A function with a primitive return type.
captures:
1: storage.type.primitive.dart
2: function.name.dart
push:
- meta_scope: meta.parameter.function.dart
- match: \)
pop: true
- include: decl-function-parameter
- include: strings
- include: keywords
- match: \b(new)\b\s+(\w+)(?=\()
comment: A class instantiation after 'new'
captures:
1: keyword.declaration.dart
2: function.name.dart
push:
- meta_scope: meta.invocation.function.dart
- match: \)
pop: true
- include: decl-function-parameter
- include: strings
- include: keywords
- match: (?:\b(\w+)\b)\s+(\w+)(?=\()
comment: A function with a user-defined return type.
captures:
1: type.user-defined.dart
2: function.name.dart
push:
- meta_scope: meta.parameter.function.dart
- match: \)
pop: true
- include: decl-function-parameter
- include: strings
- include: keywords
- match: (\w+)(?=\()
comment: A function with no return type.
captures:
1: function.name.dart
push:
- meta_scope: meta.parameter.function.dart
- match: \)
pop: true
- include: decl-function-parameter
- include: strings
- include: keywords
decl-typedef:
- match: typedef
captures:
0: keyword.control.new.dart
push:
- meta_scope: meta.declaration.typedef.dart
- match: ;
captures:
0: punctuation.terminator.dart
pop: true
- match: '(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b|([a-zA-Z_][a-zA-Z0-9_]*))\s+([a-zA-Z_][a-zA-Z0-9_]+)'
captures:
1: storage.type.primitive.dart
2: typedef.return.dart
3: typedef.name.dart
- match: \(
push:
- meta_scope: typedef.params.dart
- match: \)
pop: true
- include: keywords
keywords:
- match: \bassert\b
scope: keyword.control.assert.dart
- match: \bas\b
scope: keyword.cast.dart
- match: \b(try|catch|finally|throw|on|rethrow)\b
scope: keyword.control.catch-exception.dart
- match: \s+\?\s+|\s+:\s+
scope: keyword.control.ternary.dart
- match: \b(break|case|continue|default|do|else|for|if|in|return|switch|while)\b
scope: keyword.control.dart
- match: \b(async\*|async|await\*|await|yield)\b
scope: keyword.control.async.dart
- match: \b(new)\b
scope: keyword.control.new.dart
- match: \b(abstract|extends|external|factory|implements|with|interface|get|native|operator|set|typedef)\b
scope: keyword.declaration.dart
- match: \b(is\!?)\b
scope: keyword.operator.dart
- match: (<<|>>>?|~|\^|\||&)
scope: keyword.operator.bitwise.dart
- match: ((&|\^|\||<<|>>>?)=)
scope: keyword.operator.assignment.bitwise.dart
- match: (===?|!==?|<=?|>=?)
scope: keyword.operator.comparison.dart
- match: '(([+*/%-]|\~)=)'
scope: keyword.operator.assignment.arithmetic.dart
- match: (=)
scope: keyword.operator.assignment.dart
- match: (\-\-|\+\+)
scope: keyword.operator.increment-decrement.dart
- match: (\-|\+|\*|\/|\~\/|%)
scope: keyword.operator.arithmetic.dart
- match: (!|&&|\|\|)
scope: keyword.operator.logical.dart
- match: ;
scope: punctuation.terminator.dart
- match: \b(static|final|const)\b
scope: storage.modifier.dart
- match: \b(?:void|bool|num|int|double|dynamic|var|String|List|Map)\b
scope: storage.type.primitive.dart
regexp:
- match: '\\[^''"]'
scope: constant.character.escaped.regex.dart
- match: \(
push:
- meta_content_scope: meta.capture.regex.dart
- match: \)
pop: true
- match: \?(:|=|!)
scope: ignore.capture.regex.dart
- match: \*|\+|\?|\.|\|
scope: keyword.other.regex.dart
- match: \^|\$
scope: keyword.other.regex.dart
- match: \.
scope: constant.other.regex.dart
- match: '\[(\^)?'
captures:
1: keyword.other.negation.regex.dart
push:
- meta_scope: constant.character.range.regex.dart
- match: '\]'
pop: true
- match: '\\[^"'']'
scope: constant.character.escaped.regex.dart
- match: '\{(?:\d+)?,(?:\d+)?\}'
scope: keyword.other.regex.dart
string-interp:
- match: '(\$)(\{)'
captures:
1: keyword.other.dart
2: keyword.other.dart
push:
- meta_scope: interpolation.dart
- meta_content_scope: source.dart
- match: '(\})'
captures:
1: keyword.other.dart
pop: true
- include: main
- match: (\$)(\w+)
captures:
1: keyword.other.dart
2: variable.parameter.dart
- match: \\.
scope: constant.character.escape.dart
strings:
- match: (?<!r)"""
push:
- meta_scope: string.interpolated.triple.double.dart
- match: '"""(?!")'
pop: true
- include: string-interp
- match: (?<!r)'''
push:
- meta_scope: string.interpolated.triple.single.dart
- match: "'''(?!')"
pop: true
- include: string-interp
- match: r"""
push:
- meta_scope: string.quoted.triple.double.dart
- match: '"""(?!")'
pop: true
- match: r'''
push:
- meta_scope: string.quoted.triple.single.dart
- match: "'''(?!')"
pop: true
- match: (?<!\\|r)"
push:
- meta_scope: string.interpolated.double.dart
- match: '"'
pop: true
- match: \n
scope: invalid.string.newline
- include: string-interp
- match: r"
push:
- meta_scope: string.quoted.double.dart
- match: '"'
pop: true
- include: regexp
- match: (?<!\|r)'
push:
- meta_scope: string.interpolated.single.dart
- match: "'"
pop: true
- include: string-interp
- match: r'
push:
- meta_scope: string.quoted.single.dart
- match: "'"
pop: true
- include: regexp
Vendored Submodule
+1
Submodule assets/syntaxes/Docker added at 6e521ead6c
Vendored Submodule
+1
Submodule assets/syntaxes/DotENV added at f6cad1140c
+88
View File
@@ -0,0 +1,88 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: DotENV
file_extensions:
- .env
- .envrc
- .env.dist
- .env.local
- .env.sample
- .env.example
- .env.test
- .env.test.local
- .env.dev
- .env.development
- .env.development.local
- .env.prod
- .env.production
- .env.production.local
- .env.dusk.local
scope: source.env
contexts:
main:
- match: (#).*$\n?
comment: "Comments - starts with #"
scope: comment.line.number-sign.env
captures:
1: punctuation.definition.comment.env
- match: (\")
comment: Strings (double)
captures:
1: punctuation.definition.string.begin.env
push:
- meta_scope: string.quoted.double.env
- match: (\")
captures:
1: punctuation.definition.string.end
pop: true
- include: interpolation
- include: variable
- include: escape-characters
- match: (\')
comment: Strings (single)
captures:
1: punctuation.definition.string.begin.env
push:
- meta_scope: string.quoted.single.env
- match: (\')
captures:
1: punctuation.definition.string.end
pop: true
- match: '(?<=[\w])\s?='
comment: Assignment Operator
scope: keyword.operator.assignment.env
- match: '([\w]+)(?=\s?\=)'
comment: Variable
scope: variable.other.env
- match: (?i)\s?(export)
comment: Keywords
scope: keyword.other.env
- match: (?i)(?<=\=)\s?(true|false|null)
comment: Constants
scope: constant.language.env
- match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b'
comment: Numeric
scope: constant.numeric.env
escape-characters:
- match: '\\[nrt\\\$\"\'']'
scope: constant.character.escape.env
interpolation:
- match: '(\$\{|\{)'
comment: 'Template Syntax: "foo ${bar} {$baz}"'
captures:
1: string.interpolated.env keyword.other.template.begin.env
push:
- match: '(\})'
captures:
1: string.interpolated.env keyword.other.template.end.env
pop: true
- match: '(?x)(\$+)?([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
captures:
1: punctuation.definition.variable.env variable.other.env
2: variable.other.env
variable:
- match: '(?x)(\$+)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
captures:
1: punctuation.definition.variable.env variable.other.env
2: variable.other.env
Vendored Submodule
+1
Submodule assets/syntaxes/Elixir added at 044d9af8a1
Vendored Submodule
+1
Submodule assets/syntaxes/Elm added at dfbb8bdc9a
Vendored Submodule
+1
Submodule assets/syntaxes/FSharp added at c18616d6bd
+672
View File
@@ -0,0 +1,672 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: "F#"
file_extensions:
- fs
- fsi
- fsx
scope: source.fsharp
contexts:
main:
- include: compiler_directives
- include: comments
- include: constants
- include: strings
- include: chars
- include: double_tick
- include: definition
- include: abstract_definition
- include: attributes
- include: modules
- include: anonymous_functions
- include: du_declaration
- include: record_declaration
- include: records
- include: strp_inlined
- include: keywords
- include: cexprs
- include: text
abstract_definition:
- match: '\b(abstract)\s+(member)?(\s+\[\<.*\>\])?\s*([_[:alpha:]0-9,\._`\s]+)(:)'
captures:
1: keyword.fsharp
2: keyword.fsharp
3: support.function.attribute.fsharp
5: keyword.fsharp
push:
- meta_scope: abstract.definition.fsharp
- match: \s*(with)\b|=|$
captures:
1: keyword.fsharp
pop: true
- include: comments
- include: common_declaration
- match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([[:alpha:]0-9''`^._ ]+)){0,1}'
captures:
1: keyword.symbol.fsharp
2: variable.parameter.fsharp
3: keyword.symbol.fsharp
4: entity.name.type.fsharp
- match: '(?!with|get|set\b)\b([\w0-9''`^._]+)'
captures:
1: entity.name.type.fsharp
- include: keywords
anonymous_functions:
- match: \b(fun)\b
captures:
1: keyword.fsharp
push:
- meta_scope: function.anonymous
- match: (->)
captures:
1: keyword.fsharp
pop: true
- include: comments
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: \s*(?=(->))
captures:
1: keyword.symbol.fsharp
pop: true
- include: member_declaration
- include: variables
attributes:
- match: '\[\<'
push:
- meta_scope: support.function.attribute.fsharp
- match: '\>\]|\]'
pop: true
- include: main
cexprs:
- match: '\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\s*\{'
scope: cexpr.fsharp
captures:
0: keyword.fsharp
chars:
- match: ('\\?.')
scope: char.fsharp
captures:
1: string.quoted.single.fsharp
comments:
- match: (\(\*(?!\)))
captures:
1: comment.block.fsharp
push:
- meta_scope: comment.block.fsharp
- match: (\*\))
captures:
1: comment.block.fsharp
pop: true
- match: //.*$
scope: comment.line.double-slash.fsharp
common_binding_definition:
- include: comments
- include: attributes
- match: (:)\s*(\()\s*(static member|member)
captures:
1: keyword.symbol.fsharp
2: keyword.symbol.fsharp
3: keyword.fsharp
push:
- match: (\))\s*((?=,)|(?=\=))
captures:
1: keyword.symbol.fsharp
pop: true
- match: '(\^[[:alpha:]0-9''._]+)'
captures:
1: entity.name.type.fsharp
- include: variables
- include: keywords
- match: (:)\s*(\()
captures:
1: keyword.symbol.fsharp
2: keyword.symbol.fsharp
push:
- match: '(\)\s*(([?[:alpha:]0-9''`^._ ]*)))'
captures:
1: keyword.symbol.fsharp
2: entity.name.type.fsharp
pop: true
- include: tuple_signature
- match: '(:)\s*(\^[[:alpha:]0-9''._]+)\s*(when)'
captures:
1: keyword.symbol.fsharp
2: entity.name.type.fsharp
3: keyword.fsharp
push:
- match: (?=:)
captures:
1: keyword.symbol.fsharp
pop: true
- match: \b(and|when|or)\b
scope: keyword.fsharp
- match: "([[:alpha:]0-9'^._]+)"
comment: Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition
captures:
1: entity.name.type.fsharp
- match: (\(|\))
scope: keyword.symbol.fsharp
- match: '(:)\s*([?[:alpha:]0-9''`^._ ]+)'
captures:
1: keyword.symbol.fsharp
2: entity.name.type.fsharp
- match: '(->)\s*(\()?\s*([?[:alpha:]0-9''`^._ ]+)*'
captures:
1: keyword.symbol.fsharp
2: keyword.symbol.fsharp
3: entity.name.type.fsharp
- match: (\*)\s*(\()
captures:
1: keyword.symbol.fsharp
2: keyword.symbol.fsharp
push:
- match: '(\)\s*(([?[:alpha:]0-9''`^._ ]+))+)'
captures:
1: keyword.symbol.fsharp
2: entity.name.type.fsharp
pop: true
- include: tuple_signature
- match: '(\*)(\s*([?[:alpha:]0-9''`^._ ]+))*'
captures:
1: keyword.symbol.fsharp
2: entity.name.type.fsharp
- match: '(<(?![[:space:]]*\)))'
captures:
1: keyword.symbol.fsharp
push:
- match: ((?<!:)>)
captures:
1: keyword.symbol.fsharp
pop: true
- include: generic_declaration
- match: "({)"
captures:
1: keyword.symbol.fsharp
push:
- match: "(})"
captures:
1: keyword.symbol.fsharp
pop: true
- include: record_signature
- include: definition
- include: variables
- include: keywords
common_declaration:
- match: '\s*(->)\s*([[:alpha:]0-9''`^._ ]+)(<)'
captures:
1: keyword.symbol.fsharp
2: entity.name.type.fsharp
3: keyword.symbol.fsharp
push:
- match: (>)
captures:
1: keyword.symbol.fsharp
pop: true
- match: "([[:alpha:]0-9'`^._ ]+)"
captures:
1: entity.name.type.fsharp
- include: keywords
- match: '\s*(->)\s*(?!with|get|set\b)\b([\w0-9''`^._]+)'
captures:
1: keyword.symbol.fsharp
2: entity.name.type.fsharp
- match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([?[:alpha:]0-9''`^._ ]+)(<))'
captures:
1: keyword.symbol.fsharp
2: variable.parameter.fsharp
3: keyword.symbol.fsharp
4: keyword.symbol.fsharp
5: entity.name.type.fsharp
push:
- match: (>)
captures:
1: keyword.symbol.fsharp
pop: true
- match: "([[:alpha:]0-9'`^._ ]+)"
captures:
1: entity.name.type.fsharp
- include: keywords
compiler_directives:
- match: \s?(#if|#elif|#else|#elseif|#endif|#light|#nowarn)
scope: compiler_directive.fsharp
captures:
constants:
- match: \(\)
scope: constant.language.unit.fsharp
- match: '\b-?[0-9][0-9_]*((\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))'
scope: constant.numeric.floating-point.fsharp
- match: '\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))'
scope: constant.numeric.integer.nativeint.fsharp
- match: \b(true|false|null|unit)\b
scope: constant.others.fsharp
definition:
- match: '\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?'
captures:
1: keyword.fsharp
2: keyword.fsharp
3: support.function.attribute.fsharp
4: keyword.fsharp
5: variable.fsharp
push:
- meta_scope: binding.fsharp
- match: \s*(with\b|=|\n+=|(?<=\=))
captures:
1: keyword.fsharp
pop: true
- include: common_binding_definition
- match: '\b(static val mutable|val mutable|val)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?'
captures:
1: keyword.fsharp
2: keyword.fsharp
3: support.function.attribute.fsharp
4: keyword.fsharp
5: variable.fsharp
push:
- meta_scope: binding.fsharp
- match: \n$
pop: true
- include: common_binding_definition
double_tick:
- match: (``)(.*)(``)
scope: variable.other.binding.fsharp
captures:
1: string.quoted.single.fsharp
2: variable.other.binding.fsharp
3: string.quoted.single.fsharp
du_declaration:
- match: \b(of)\b
captures:
1: keyword.fsharp
push:
- meta_scope: du_declaration.fsharp
- match: $|(\|)
captures:
1: keyword.symbol.fsharp
pop: true
- include: comments
- match: '([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)'
captures:
1: variable.parameter.fsharp
2: keyword.symbol.fsharp
3: entity.name.type.fsharp
- match: "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``"
captures:
1: entity.name.type.fsharp
- include: keywords
generic_declaration:
- match: (:)\s*(\()\s*(static member|member)
captures:
1: keyword.symbol.fsharp
2: keyword.symbol.fsharp
3: keyword.fsharp
push:
- match: (\))
captures:
1: keyword.symbol.fsharp
pop: true
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: (\))
captures:
1: keyword.symbol.fsharp
pop: true
- include: member_declaration
- match: '((''|\^)[[:alpha:]0-9''._]+)'
captures:
1: entity.name.type.fsharp
- include: variables
- include: keywords
- match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\!|struct|while|mutable)(?!')\b
scope: keyword.fsharp
- match: ":"
scope: keyword.fsharp
- include: constants
- match: '((''|\^)[[:alpha:]0-9''._]+)'
captures:
1: entity.name.type.fsharp
- match: (<)
captures:
1: keyword.symbol.fsharp
push:
- match: (>)
captures:
1: keyword.symbol.fsharp
pop: true
- match: '((''|\^)[[:alpha:]0-9''._]+)'
captures:
1: entity.name.type.fsharp
- include: tuple_signature
- include: generic_declaration
- match: '(?!when|and|or\b)\b([\w0-9''`^._]+)'
captures:
1: entity.name.type.fsharp
- match: (\|)
captures:
1: keyword.symbol.fsharp
- include: keywords
keywords:
- match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|or|use|use\!|struct|while|mutable)(?!')\b
scope: keyword.fsharp
- match: '(&&&|\|\|\||\^\^\^|~~~|<<<|>>>|\|>|\->|\<\-|:>|:\?>|:|\[|\]|\;|<>|=|@|\|\||&&|{|}|\||_|\.\.|\,|\+|\-|\*|\/|\^|\!|\>|\>\=|\>\>|\<|\<\=|\(|\)|\<\<)'
scope: keyword.symbol.fsharp
member_declaration:
- include: comments
- include: common_declaration
- match: (:)\s*(\()\s*(static member|member)
captures:
1: keyword.symbol.fsharp
2: keyword.symbol.fsharp
3: keyword.fsharp
push:
- match: (\))\s*((?=,)|(?=\=))
captures:
1: keyword.symbol.fsharp
pop: true
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: (\))
captures:
1: keyword.symbol.fsharp
pop: true
- include: member_declaration
- match: '(\^[[:alpha:]0-9''._]+)'
captures:
1: entity.name.type.fsharp
- include: variables
- include: keywords
- match: '(\^[[:alpha:]0-9''._]+)'
captures:
1: entity.name.type.fsharp
- match: \b(and|when|or)\b
scope: keyword.fsharp
- match: (\(|\))
scope: keyword.symbol.fsharp
- match: '(\?{0,1})([[:alpha:]0-9''`^._]+|``[[:alpha:]0-9''`^:,._ ]+``)\s*(:{0,1})(\s*([?[:alpha:]0-9''`<>._ ]+)){0,1}'
captures:
1: keyword.symbol.fsharp
2: variable.parameter.fsharp
3: keyword.symbol.fsharp
4: entity.name.type.fsharp
- include: keywords
modules:
- match: '\b(namespace|module)\s*(public|internal|private)?\s+([[:alpha:]][[:alpha:]0-9''_. ]*)'
captures:
1: keyword.fsharp
2: keyword.fsharp
3: entity.name.section.fsharp
push:
- meta_scope: entity.name.section.fsharp
- match: (\s?=|\s|$)
captures:
1: keyword.symbol.fsharp
pop: true
- match: '(\.)([A-Z][[:alpha:]0-9''_]*)'
scope: entity.name.section.fsharp
captures:
1: punctuation.separator.namespace-reference.fsharp
2: entity.name.section.fsharp
- match: '\b(open)\s+([[:alpha:]][[:alpha:]0-9''_]*)(?=(\.[A-Z][[:alpha:]0-9_]*)*)'
captures:
1: keyword.fsharp
2: entity.name.section.fsharp
push:
- meta_scope: namespace.open.fsharp
- match: (\s|$)
pop: true
- match: '(\.)([[:alpha:]][[:alpha:]0-9''_]*)'
scope: entity.name.section.fsharp
captures:
1: punctuation.separator.namespace-reference.fsharp
2: entity.name.section.fsharp
- match: '^\s*(module)\s+([A-Z][[:alpha:]0-9''_]*)\s*(=)\s*([A-Z][[:alpha:]0-9''_]*)'
captures:
1: keyword.fsharp
2: entity.name.type.namespace.fsharp
3: punctuation.separator.namespace-definition.fsharp
4: entity.name.section.fsharp
push:
- meta_scope: namespace.alias.fsharp
- match: (\s|$)
pop: true
- match: '(\.)([A-Z][[:alpha:]0-9''_]*)'
scope: entity.name.section.fsharp
captures:
1: punctuation.separator.namespace-reference.fsharp
2: entity.name.section.fsharp
record_declaration:
- match: '(\{)'
captures:
1: keyword.symbol.fsharp
push:
- match: '(?<=\})'
pop: true
- include: comments
- match: '(((mutable)\s[[:alpha:]]+)|[[:alpha:]0-9''`<>^._]*)\s*((?<!:):(?!:))\s*'
captures:
3: keyword.fsharp
4: keyword.symbol.fsharp
push:
- match: '$|(;|\})'
captures:
1: keyword.symbol.fsharp
pop: true
- include: comments
- match: "([[:alpha:]0-9'`^_ ]+)"
captures:
1: entity.name.type.fsharp
- include: keywords
- include: compiler_directives
- include: constants
- include: strings
- include: chars
- include: double_tick
- include: definition
- include: attributes
- include: anonymous_functions
- include: keywords
- include: cexprs
- include: text
record_signature:
- match: "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)"
captures:
1: keyword.symbol.fsharp
2: variable.parameter.fsharp
- match: "({)"
captures:
1: keyword.symbol.fsharp
push:
- match: "(})"
captures:
1: keyword.symbol.fsharp
pop: true
- match: "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)"
captures:
1: keyword.symbol.fsharp
2: variable.parameter.fsharp
- include: record_signature
- include: keywords
records:
- match: '\b(type)[\s]+(private|internal|public)?\s*'
captures:
1: keyword.fsharp
2: keyword.fsharp
push:
- meta_scope: record.fsharp
- match: '\s*((with)|((as)\s+([[:alpha:]0-9'']+))|(=)|[\n=]|(\(\)))'
captures:
2: keyword.fsharp
3: keyword.fsharp
4: keyword.fsharp
5: variable.parameter.fsharp
6: keyword.symbol.fsharp
7: constant.language.unit.fsharp
pop: true
- include: comments
- include: attributes
- match: "([[:alpha:]0-9'^._]+|``[[:alpha:]0-9'`^:,._ ]+``)"
captures:
1: entity.name.type.fsharp
- match: (<)
captures:
1: keyword.fsharp
push:
- match: ((?<!:)>)
captures:
1: keyword.fsharp
pop: true
- match: '((''|\^)``[[:alpha:]0-9`^:,._ ]+``|(''|\^)[[:alpha:]0-9`^:._]+)'
captures:
1: entity.name.type.fsharp
- match: \b(interface|with|abstract|and|when|or|not|struct|equality|comparison|unmanaged|delegate|enum)\b
scope: keyword.fsharp
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: (\))
captures:
1: keyword.symbol.fsharp
pop: true
- match: (static member|member|new)
captures:
1: keyword.fsharp
- include: common_binding_definition
- match: '([\w0-9''`^._]+)'
captures:
1: entity.name.type.fsharp
- include: keywords
- match: \s*(private|internal|public)
captures:
1: keyword.symbol.fsharp
2: keyword.fsharp
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: '\s*(?=(=)|[\n=]|(\(\))|(as))'
captures:
1: keyword.symbol.fsharp
pop: true
- include: member_declaration
- include: keywords
string_formatter:
- match: (%0?-?(\d+)?((a|t)|(\.\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\+?A)))
scope: entity.name.type.format.specifier.fsharp
captures:
1: keyword.format.specifier.fsharp
strings:
- match: '(?=[^\\])(@")'
captures:
1: punctuation.definition.string.begin.fsharp
push:
- meta_scope: string.quoted.literal.fsharp
- match: (")(?!")
captures:
1: punctuation.definition.string.end.fsharp
pop: true
- match: '"(")'
scope: constant.character.string.escape.fsharp
- match: '(?=[^\\])(""")'
captures:
1: punctuation.definition.string.begin.fsharp
push:
- meta_scope: string.quoted.triple.fsharp
- match: (""")
captures:
1: punctuation.definition.string.end.fsharp
pop: true
- include: string_formatter
- match: '(?=[^\\])(")'
captures:
1: punctuation.definition.string.begin.fsharp
push:
- meta_scope: string.quoted.double.fsharp
- match: (")
captures:
1: punctuation.definition.string.end.fsharp
pop: true
- match: '\\$[ \t]*'
scope: punctuation.separator.string.ignore-eol.fsharp
- match: '\\([\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})'
scope: constant.character.string.escape.fsharp
- match: '\\(?![\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).'
scope: invalid.illeagal.character.string.fsharp
- include: string_formatter
strp_inlined:
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: (\))
captures:
1: keyword.symbol.fsharp
pop: true
- include: strp_inlined_body
strp_inlined_body:
- include: comments
- include: anonymous_functions
- match: '(\^[[:alpha:]0-9''._]+)'
captures:
1: entity.name.type.fsharp
- match: \b(and|when|or)\b
scope: keyword.fsharp
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: (\))
captures:
1: keyword.symbol.fsharp
pop: true
- include: strp_inlined_body
- match: '(static member|member)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)'
captures:
1: keyword.fsharp
2: variable.fsharp
3: keyword.symbol.fsharp
- include: compiler_directives
- include: constants
- include: strings
- include: chars
- include: double_tick
- include: keywords
- include: text
- include: definition
- include: attributes
- include: keywords
- include: cexprs
- include: text
text:
- match: \\
scope: text.fsharp
tuple_signature:
- match: "(([?[:alpha:]0-9'`^._ ]+))+"
captures:
1: entity.name.type.fsharp
- match: (\()
captures:
1: keyword.symbol.fsharp
push:
- match: (\))
captures:
1: keyword.symbol.fsharp
pop: true
- match: "(([?[:alpha:]0-9'`^._ ]+))+"
captures:
1: entity.name.type.fsharp
- include: tuple_signature
- include: keywords
variables:
- match: \(\)
scope: constant.language.unit.fsharp
- match: '(\?{0,1})(``[[:alpha:]0-9''`^:,._ ]+``|[[:alpha:]0-9''`<>^._ ]\w*)'
captures:
1: keyword.symbol.fsharp
2: variable.parameter.fsharp
Vendored Submodule
+1
Submodule assets/syntaxes/GraphQL added at 66ce8713d8
+662
View File
@@ -0,0 +1,662 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: HTML (Twig)
file_extensions:
- twig
- html.twig
scope: text.html.twig
contexts:
main:
- match: '(<)([a-zA-Z0-9:]++)(?=[^>]*></\2>)'
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.html
push:
- meta_scope: meta.tag.any.html
- match: (>(<)/)(\2)(>)
captures:
1: punctuation.definition.tag.html
2: meta.scope.between-tag-pair.html
3: entity.name.tag.html
4: punctuation.definition.tag.html
pop: true
- include: tag-stuff
- match: (<\?)(xml)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.xml.html
push:
- meta_scope: meta.tag.preprocessor.xml.html
- match: (\?>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.xml.html
pop: true
- include: tag-generic-attribute
- include: string-double-quoted
- include: string-single-quoted
- match: <!--
captures:
0: punctuation.definition.comment.html
push:
- meta_scope: comment.block.html
- match: '--\s*>'
captures:
0: punctuation.definition.comment.html
pop: true
- match: "--"
scope: invalid.illegal.bad-comments-or-CDATA.html
- include: embedded-code
- match: <!
captures:
0: punctuation.definition.tag.html
push:
- meta_scope: meta.tag.sgml.html
- match: ">"
captures:
0: punctuation.definition.tag.html
pop: true
- match: (?i:DOCTYPE)
captures:
1: entity.name.tag.doctype.html
push:
- meta_scope: meta.tag.sgml.doctype.html
- match: (?=>)
captures:
1: entity.name.tag.doctype.html
pop: true
- match: '"[^">]*"'
scope: string.quoted.double.doctype.identifiers-and-DTDs.html
- match: '\[CDATA\['
push:
- meta_scope: constant.other.inline-data.html
- match: "]](?=>)"
pop: true
- match: (\s*)(?!--|>)\S(\s*)
scope: invalid.illegal.bad-comments-or-CDATA.html
- include: embedded-code
- match: '(?:^\s+)?(<)((?i:style))\b(?![^>]*/>)'
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.style.html
3: punctuation.definition.tag.html
push:
- meta_scope: source.css.embedded.html
- match: (</)((?i:style))(>)(?:\s*\n)?
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.style.html
3: punctuation.definition.tag.html
pop: true
- include: tag-stuff
- match: (>)
captures:
1: punctuation.definition.tag.html
push:
- match: (?=</(?i:style))
pop: true
- include: embedded-code
- include: scope:source.css
- match: '(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)'
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
push:
- meta_scope: source.js.embedded.html
- match: (?<=</(script|SCRIPT))(>)(?:\s*\n)?
captures:
2: punctuation.definition.tag.html
pop: true
- include: tag-stuff
- match: (?<!</(?:script|SCRIPT))(>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
push:
- match: (</)((?i:script))
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
pop: true
- match: (//).*?((?=</script)|$\n?)
scope: comment.line.double-slash.js
captures:
1: punctuation.definition.comment.js
- match: /\*
captures:
0: punctuation.definition.comment.js
push:
- meta_scope: comment.block.js
- match: \*/|(?=</script)
captures:
0: punctuation.definition.comment.js
pop: true
- include: php
- include: twig-print-tag
- include: twig-statement-tag
- include: twig-comment-tag
- include: scope:source.js
- match: (</?)((?i:body|head|html)\b)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.structure.any.html
push:
- meta_scope: meta.tag.structure.any.html
- match: (>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.structure.any.html
pop: true
- include: tag-stuff
- match: (</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\b)
captures:
1: punctuation.definition.tag.begin.html
2: entity.name.tag.block.any.html
push:
- meta_scope: meta.tag.block.any.html
- match: (>)
captures:
1: punctuation.definition.tag.end.html
pop: true
- include: tag-stuff
- match: (</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b)
captures:
1: punctuation.definition.tag.begin.html
2: entity.name.tag.inline.any.html
push:
- meta_scope: meta.tag.inline.any.html
- match: "((?: ?/)?>)"
captures:
1: punctuation.definition.tag.end.html
pop: true
- include: tag-stuff
- match: "(</?)([a-zA-Z0-9:]+)"
captures:
1: punctuation.definition.tag.begin.html
2: entity.name.tag.other.html
push:
- meta_scope: meta.tag.other.html
- match: (>)
captures:
1: punctuation.definition.tag.end.html
pop: true
- include: tag-stuff
- include: entities
- match: <>
scope: invalid.illegal.incomplete.html
- match: <
scope: invalid.illegal.bad-angle-bracket.html
- include: twig-print-tag
- include: twig-statement-tag
- include: twig-comment-tag
embedded-code:
- include: ruby
- include: php
- include: twig-print-tag
- include: twig-statement-tag
- include: twig-comment-tag
- include: python
entities:
- match: "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
scope: constant.character.entity.html
captures:
1: punctuation.definition.entity.html
3: punctuation.definition.entity.html
- match: "&"
scope: invalid.illegal.bad-ampersand.html
php:
- match: (?=(^\s*)?<\?)
push:
- match: (?!(^\s*)?<\?)
pop: true
- include: scope:text.html.php
python:
- match: (?:^\s*)<\?python(?!.*\?>)
push:
- meta_scope: source.python.embedded.html
- match: \?>(?:\s*$\n)?
pop: true
- include: scope:source.python
ruby:
- match: "<%+#"
captures:
0: punctuation.definition.comment.erb
push:
- meta_scope: comment.block.erb
- match: "%>"
captures:
0: punctuation.definition.comment.erb
pop: true
- match: <%+(?!>)=?
captures:
0: punctuation.section.embedded.ruby
push:
- meta_scope: source.ruby.embedded.html
- match: "-?%>"
captures:
0: punctuation.section.embedded.ruby
pop: true
- match: (#).*?(?=-?%>)
scope: comment.line.number-sign.ruby
captures:
1: punctuation.definition.comment.ruby
- include: scope:source.ruby
- match: <\?r(?!>)=?
captures:
0: punctuation.section.embedded.ruby.nitro
push:
- meta_scope: source.ruby.nitro.embedded.html
- match: '-?\?>'
captures:
0: punctuation.section.embedded.ruby.nitro
pop: true
- match: (#).*?(?=-?\?>)
scope: comment.line.number-sign.ruby.nitro
captures:
1: punctuation.definition.comment.ruby.nitro
- include: scope:source.ruby
string-double-quoted:
- match: '"'
captures:
0: punctuation.definition.string.begin.html
push:
- meta_scope: string.quoted.double.html
- match: '"'
captures:
0: punctuation.definition.string.end.html
pop: true
- include: embedded-code
- include: entities
string-single-quoted:
- match: "'"
captures:
0: punctuation.definition.string.begin.html
push:
- meta_scope: string.quoted.single.html
- match: "'"
captures:
0: punctuation.definition.string.end.html
pop: true
- include: embedded-code
- include: entities
tag-generic-attribute:
- match: '\b([a-zA-Z\-:]+)'
scope: entity.other.attribute-name.html
tag-id-attribute:
- match: \b(id)\b\s*(=)
captures:
1: entity.other.attribute-name.id.html
2: punctuation.separator.key-value.html
push:
- meta_scope: meta.attribute-with-value.id.html
- match: (?<='|")
captures:
1: entity.other.attribute-name.id.html
2: punctuation.separator.key-value.html
pop: true
- match: '"'
captures:
0: punctuation.definition.string.begin.html
push:
- meta_scope: string.quoted.double.html
- meta_content_scope: meta.toc-list.id.html
- match: '"'
captures:
0: punctuation.definition.string.end.html
pop: true
- include: embedded-code
- include: entities
- match: "'"
captures:
0: punctuation.definition.string.begin.html
push:
- meta_scope: string.quoted.single.html
- meta_content_scope: meta.toc-list.id.html
- match: "'"
captures:
0: punctuation.definition.string.end.html
pop: true
- include: embedded-code
- include: entities
tag-stuff:
- include: tag-id-attribute
- include: tag-generic-attribute
- include: string-double-quoted
- include: string-single-quoted
- include: embedded-code
twig-arrays:
- match: '(?<=[\s\(\{\[:,])\['
captures:
0: punctuation.section.array.begin.twig
push:
- meta_scope: meta.array.twig
- match: '\]'
captures:
0: punctuation.section.array.end.twig
pop: true
- include: twig-arrays
- include: twig-hashes
- include: twig-constants
- include: twig-strings
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- match: ","
scope: punctuation.separator.object.twig
twig-comment-tag:
- match: '\{#-?'
captures:
0: punctuation.definition.comment.begin.twig
push:
- meta_scope: comment.block.twig
- match: '-?#\}'
captures:
0: punctuation.definition.comment.end.twig
pop: true
twig-constants:
- match: '(?i)(?<=[\s\[\(\{:,])(?:true|false|null|none)(?=[\s\)\]\}\,])'
scope: constant.language.twig
- match: '(?<=[\s\[\(\{:,]|\.\.|\*\*)[0-9]+(?:\.[0-9]+)?(?=[\s\)\]\}\,]|\.\.|\*\*)'
scope: constant.numeric.twig
twig-filters:
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)(abs|capitalize|e(?:scape)?|first|join|(?:json|url)_encode|keys|last|length|lower|nl2br|number_format|raw|reverse|round|sort|striptags|title|trim|upper)(?=[\s\|\]\}\):,]|\.\.|\*\*)'
captures:
1: support.function.twig
twig-filters-ud:
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)'
captures:
1: meta.function-call.other.twig
twig-filters-warg:
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)(batch|convert_encoding|date|date_modify|default|e(?:scape)?|format|join|merge|number_format|replace|round|slice|split|trim)(\()'
captures:
1: support.function.twig
2: punctuation.definition.parameters.begin.twig
push:
- meta_content_scope: meta.function.arguments.twig
- match: \)
captures:
0: punctuation.definition.parameters.end.twig
pop: true
- include: twig-constants
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- include: twig-strings
- include: twig-arrays
- include: twig-hashes
twig-filters-warg-ud:
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\()'
captures:
1: meta.function-call.other.twig
2: punctuation.definition.parameters.begin.twig
push:
- meta_content_scope: meta.function.arguments.twig
- match: \)
captures:
0: punctuation.definition.parameters.end.twig
pop: true
- include: twig-constants
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- include: twig-strings
- include: twig-arrays
- include: twig-hashes
twig-functions:
- match: (?<=is\s)(defined|empty|even|iterable|odd)
captures:
1: support.function.twig
twig-functions-warg:
- match: '(?<=[\s\(\[\{:,])(attribute|block|constant|cycle|date|divisible by|dump|include|max|min|parent|random|range|same as|source|template_from_string)(\()'
captures:
1: support.function.twig
2: punctuation.definition.parameters.begin.twig
push:
- meta_content_scope: meta.function.arguments.twig
- match: \)
captures:
0: punctuation.definition.parameters.end.twig
pop: true
- include: twig-constants
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- include: twig-strings
- include: twig-arrays
twig-hashes:
- match: '(?<=[\s\(\{\[:,])\{'
captures:
0: punctuation.section.hash.begin.twig
push:
- meta_scope: meta.hash.twig
- match: '\}'
captures:
0: punctuation.section.hash.end.twig
pop: true
- include: twig-hashes
- include: twig-arrays
- include: twig-constants
- include: twig-strings
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- match: ":"
scope: punctuation.separator.key-value.twig
- match: ","
scope: punctuation.separator.object.twig
twig-keywords:
- match: (?<=\s)((?:end)?(?:autoescape|block|embed|filter|for|if|macro|raw|sandbox|set|spaceless|trans|verbatim)|as|do|else|elseif|extends|flush|from|ignore missing|import|include|only|use|with)(?=\s)
scope: keyword.control.twig
twig-macros:
- match: |-
(?x)
(?<=[\s\(\[\{:,])
([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
(?:
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
)?
(\()
captures:
1: meta.function-call.twig
2: punctuation.separator.property.twig
3: variable.other.property.twig
4: punctuation.definition.parameters.begin.twig
push:
- meta_content_scope: meta.function.arguments.twig
- match: \)
captures:
0: punctuation.definition.parameters.end.twig
pop: true
- include: twig-constants
- include: twig-operators
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- include: twig-strings
- include: twig-arrays
- include: twig-hashes
twig-objects:
- match: '(?<=[\s\{\[\(:,])([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?=[\s\}\[\]\(\)\.\|,:])'
captures:
1: variable.other.twig
twig-operators:
- match: (?<=\s)(\+|-|//?|%|\*\*?)(?=\s)
captures:
1: keyword.operator.arithmetic.twig
- match: (?<=\s)(=|~)(?=\s)
captures:
1: keyword.operator.assignment.twig
- match: (?<=\s)(b-(?:and|or|xor))(?=\s)
captures:
1: keyword.operator.bitwise.twig
- match: '(?<=\s)((?:!|=)=|<=?|>=?|(?:not )?in|is(?: not)?|(?:ends|starts) with|matches)(?=\s)'
captures:
1: keyword.operator.comparison.twig
- match: (?<=\s)(\?|:|and|not|or)(?=\s)
captures:
1: keyword.operator.logical.twig
- match: '(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]\)''"])\.\.(?=[a-zA-Z0-9_\x{7f}-\x{ff}''"])'
captures:
0: keyword.operator.other.twig
- match: '(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]\}\)''"])\|(?=[a-zA-Z_\x{7f}-\x{ff}])'
captures:
0: keyword.operator.other.twig
twig-print-tag:
- match: '\{\{-?'
captures:
0: punctuation.section.tag.twig
push:
- meta_scope: meta.tag.template.value.twig
- match: '-?\}\}'
captures:
0: punctuation.section.tag.twig
pop: true
- include: twig-constants
- include: twig-operators
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- include: twig-strings
- include: twig-arrays
- include: twig-hashes
twig-properties:
- match: |-
(?x)
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}])
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
(?=[\.\s\|\[\)\]\}:,])
captures:
1: punctuation.separator.property.twig
2: variable.other.property.twig
- match: |-
(?x)
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}])
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
(\()
captures:
1: punctuation.separator.property.twig
2: variable.other.property.twig
3: punctuation.definition.parameters.begin.twig
push:
- meta_content_scope: meta.function.arguments.twig
- match: \)
captures:
0: punctuation.definition.parameters.end.twig
pop: true
- include: twig-constants
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-objects
- include: twig-properties
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- include: twig-strings
- include: twig-arrays
- match: |-
(?x)
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]])
(?:
(\[)('[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*')(\])
|(\[)("[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*")(\])
|(\[)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\])
)
captures:
1: punctuation.section.array.begin.twig
2: variable.other.property.twig
3: punctuation.section.array.end.twig
4: punctuation.section.array.begin.twig
5: variable.other.property.twig
6: punctuation.section.array.end.twig
7: punctuation.section.array.begin.twig
8: variable.other.property.twig
9: punctuation.section.array.end.twig
twig-statement-tag:
- match: '\{%-?'
captures:
0: punctuation.section.tag.twig
push:
- meta_scope: meta.tag.template.block.twig
- match: '-?%\}'
captures:
0: punctuation.section.tag.twig
pop: true
- include: twig-constants
- include: twig-keywords
- include: twig-operators
- include: twig-functions-warg
- include: twig-functions
- include: twig-macros
- include: twig-filters-warg
- include: twig-filters
- include: twig-filters-warg-ud
- include: twig-filters-ud
- include: twig-objects
- include: twig-properties
- include: twig-strings
- include: twig-arrays
- include: twig-hashes
twig-strings:
- match: (?:(?<!\\)|(?<=\\\\))'
captures:
0: punctuation.definition.string.begin.twig
push:
- meta_scope: string.quoted.single.twig
- match: (?:(?<!\\)|(?<=\\\\))'
captures:
0: punctuation.definition.string.end.twig
pop: true
- match: (?:(?<!\\)|(?<=\\\\))"
captures:
0: punctuation.definition.string.begin.twig
push:
- meta_scope: string.quoted.double.twig
- match: (?:(?<!\\)|(?<=\\\\))"
captures:
0: punctuation.definition.string.end.twig
pop: true
+23
View File
@@ -0,0 +1,23 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: hosts
file_extensions:
- hosts
scope: source.hosts
contexts:
main:
- scope: comment.line.number-sign
match: \#.*
comment: comment
- match: ^\s*([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|[0-9a-f:]+)
comment: ipaddress
scope: constant.numeric.ipaddress
- match: \s(localhost|ip6-loopback|ip6-localhost|ip6-localnet|ip6-mcastprefix|ip6-allnodes|ip6-allrouters|ip6-allhosts|broadcasthost)\b
scope: keyword.host.predefined}
comment: prefdfined
Vendored Submodule
+1
Submodule assets/syntaxes/INI added at 8dd3e316ad
+46
View File
@@ -0,0 +1,46 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: INI
file_extensions:
- ini
- INI
- inf
- INF
- reg
- REG
- lng
- cfg
- CFG
- desktop
- url
- URL
- .editorconfig
- .hgrc
- hgrc
scope: source.ini
contexts:
main:
- match: ^\s*(;|#).*$\n?
scope: comment.line.semicolon.ini
captures:
1: punctuation.definition.comment.ini
- match: '^\s*(\[)(.*?)(\])'
scope: meta.tag.section.ini
captures:
1: punctuation.definition.section.ini
2: entity.section.ini
3: punctuation.definition.section.ini
- match: '^(\s*(["'']?)(.+?)(\2)\s*(=))?\s*((["'']?)(.*?)(\7))\s*(;.*)?$\n?'
scope: meta.declaration.ini
captures:
1: meta.property.ini
2: punctuation.definition.quote.ini
3: keyword.name.ini
4: punctuation.definition.quote.ini
5: punctuation.definition.equals.ini
6: meta.value.ini
7: punctuation.definition.quote.ini
8: string.name.value.ini
9: punctuation.definition.quote.ini
10: comment.declarationline.semicolon.ini
File diff suppressed because it is too large Load Diff
Vendored Submodule
+1
Submodule assets/syntaxes/Jsonnet added at 80775c616e
Vendored Submodule
+1
Submodule assets/syntaxes/Julia added at 581805e47c
Vendored Submodule
+1
Submodule assets/syntaxes/Kotlin added at aeeed2780b
+398
View File
@@ -0,0 +1,398 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Kotlin
file_extensions:
- kt
- kts
scope: source.Kotlin
contexts:
main:
- include: comments
- match: '^\s*(package)\b(?:\s*([^ ;$]+)\s*)?'
captures:
1: keyword.other.kotlin
2: entity.name.package.kotlin
- include: imports
- include: statements
classes:
- match: (?<!::)(?=\b(?:companion|class|object|interface)\b)
push:
- match: '(?=$|\})'
pop: true
- include: comments
- match: \b(companion\s*)?(class|object|interface)\b
captures:
1: storage.modifier.kotlin
2: storage.modifier.kotlin
push:
- match: '(?=<|\{|\(|:|$)'
pop: true
- include: comments
- match: \w+
scope: entity.name.type.class.kotlin
- match: <
push:
- match: ">"
pop: true
- include: generics
- match: \(
push:
- match: \)
pop: true
- include: parameters
- match: (:)
captures:
1: keyword.operator.declaration.kotlin
push:
- match: "(?={|$)"
pop: true
- match: \w+
scope: entity.other.inherited-class.kotlin
- match: \(
push:
- match: \)
pop: true
- include: expressions
- match: '\{'
push:
- match: '\}'
pop: true
- include: statements
comments:
- match: /\*
captures:
0: punctuation.definition.comment.kotlin
push:
- meta_scope: comment.block.kotlin
- match: \*/
captures:
0: punctuation.definition.comment.kotlin
pop: true
- match: \s*((//).*$\n?)
captures:
1: comment.line.double-slash.kotlin
2: punctuation.definition.comment.kotlin
constants:
- match: \b(true|false|null|this|super)\b
scope: constant.language.kotlin
- match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFf])?\b'
scope: constant.numeric.kotlin
- match: '\b([A-Z][A-Z0-9_]+)\b'
scope: constant.other.kotlin
expressions:
- match: \(
push:
- match: \)
pop: true
- include: expressions
- include: types
- include: strings
- include: constants
- include: comments
- include: keywords
functions:
- match: (?=\s*\b(?:fun)\b)
push:
- match: '(?=$|\})'
pop: true
- match: \b(fun)\b
captures:
1: keyword.other.kotlin
push:
- match: (?=\()
pop: true
- match: <
push:
- match: ">"
pop: true
- include: generics
- match: '([\.<\?>\w]+\.)?(\w+)'
captures:
2: entity.name.function.kotlin
- match: \(
push:
- match: \)
pop: true
- include: parameters
- match: (:)
captures:
1: keyword.operator.declaration.kotlin
push:
- match: "(?={|=|$)"
pop: true
- include: types
- match: '\{'
push:
- match: '(?=\})'
pop: true
- include: statements
- match: (=)
captures:
1: keyword.operator.assignment.kotlin
push:
- match: (?=$)
pop: true
- include: expressions
generics:
- match: (:)
captures:
1: keyword.operator.declaration.kotlin
push:
- match: (?=,|>)
pop: true
- include: types
- include: keywords
- match: \w+
scope: storage.type.generic.kotlin
getters-and-setters:
- match: \b(get)\b\s*\(\s*\)
captures:
1: entity.name.function.kotlin
push:
- match: '\}|(?=\bset\b)|$'
pop: true
- match: (=)
captures:
1: keyword.operator.assignment.kotlin
push:
- match: (?=$|\bset\b)
pop: true
- include: expressions
- match: '\{'
push:
- match: '\}'
pop: true
- include: expressions
- match: \b(set)\b\s*(?=\()
captures:
1: entity.name.function.kotlin
push:
- match: '\}|(?=\bget\b)|$'
pop: true
- match: \(
push:
- match: \)
pop: true
- include: parameters
- match: (=)
captures:
1: keyword.operator.assignment.kotlin
push:
- match: (?=$|\bset\b)
pop: true
- include: expressions
- match: '\{'
push:
- match: '\}'
pop: true
- include: expressions
imports:
- match: '^\s*(import)\s+[^ $]+\s+(as)?'
captures:
1: keyword.other.kotlin
2: keyword.other.kotlin
keywords:
- match: \b(var|val|public|private|protected|abstract|final|sealed|enum|open|attribute|annotation|override|inline|vararg|in|out|internal|data|tailrec|operator|infix|const|yield|typealias|typeof|reified|suspend)\b
scope: storage.modifier.kotlin
- match: \b(try|catch|finally|throw)\b
scope: keyword.control.catch-exception.kotlin
- match: \b(if|else|while|for|do|return|when|where|break|continue)\b
scope: keyword.control.kotlin
- match: \b(in|is|!in|!is|as|as\?|assert)\b
scope: keyword.operator.kotlin
- match: (==|!=|===|!==|<=|>=|<|>)
scope: keyword.operator.comparison.kotlin
- match: (=)
scope: keyword.operator.assignment.kotlin
- match: (::)
scope: keyword.operator.kotlin
- match: (:)
scope: keyword.operator.declaration.kotlin
- match: \b(by)\b
scope: keyword.other.by.kotlin
- match: (\?\.)
scope: keyword.operator.safenav.kotlin
- match: (\.)
scope: keyword.operator.dot.kotlin
- match: (\?:)
scope: keyword.operator.elvis.kotlin
- match: (\-\-|\+\+)
scope: keyword.operator.increment-decrement.kotlin
- match: (\+=|\-=|\*=|\/=)
scope: keyword.operator.arithmetic.assign.kotlin
- match: (\.\.)
scope: keyword.operator.range.kotlin
- match: (\-|\+|\*|\/|%)
scope: keyword.operator.arithmetic.kotlin
- match: (!|&&|\|\|)
scope: keyword.operator.logical.kotlin
- match: (;)
scope: punctuation.terminator.kotlin
namespaces:
- match: \b(namespace)\b
scope: keyword.other.kotlin
- match: '\{'
push:
- match: '\}'
pop: true
- include: statements
parameters:
- match: (:)
captures:
1: keyword.operator.declaration.kotlin
push:
- match: (?=,|\)|=)
pop: true
- include: types
- match: (=)
captures:
1: keyword.operator.declaration.kotlin
push:
- match: (?=,|\))
pop: true
- include: expressions
- include: keywords
- match: \w+
scope: variable.parameter.function.kotlin
statements:
- include: namespaces
- include: typedefs
- include: classes
- include: functions
- include: variables
- include: getters-and-setters
- include: expressions
strings:
- match: '"""'
captures:
0: punctuation.definition.string.begin.kotlin
push:
- meta_scope: string.quoted.third.kotlin
- match: '"""'
captures:
0: punctuation.definition.string.end.kotlin
pop: true
- match: '(\$\w+|\$\{[^\}]+\})'
scope: variable.parameter.template.kotlin
- match: \\.
scope: constant.character.escape.kotlin
- match: '"'
captures:
0: punctuation.definition.string.begin.kotlin
push:
- meta_scope: string.quoted.double.kotlin
- match: '"'
captures:
0: punctuation.definition.string.end.kotlin
pop: true
- match: '(\$\w+|\$\{[^\}]+\})'
scope: variable.parameter.template.kotlin
- match: \\.
scope: constant.character.escape.kotlin
- match: "'"
captures:
0: punctuation.definition.string.begin.kotlin
push:
- meta_scope: string.quoted.single.kotlin
- match: "'"
captures:
0: punctuation.definition.string.end.kotlin
pop: true
- match: \\.
scope: constant.character.escape.kotlin
- match: "`"
captures:
0: punctuation.definition.string.begin.kotlin
push:
- meta_scope: string.quoted.single.kotlin
- match: "`"
captures:
0: punctuation.definition.string.end.kotlin
pop: true
typedefs:
- match: (?=\s*(?:type))
push:
- match: (?=$)
pop: true
- match: \b(type)\b
scope: keyword.other.kotlin
- match: <
push:
- match: ">"
pop: true
- include: generics
- include: expressions
types:
- match: \b(Nothing|Any|Unit|String|CharSequence|Int|Boolean|Char|Long|Double|Float|Short|Byte|dynamic)\b
scope: storage.type.buildin.kotlin
- match: \b(IntArray|BooleanArray|CharArray|LongArray|DoubleArray|FloatArray|ShortArray|ByteArray)\b
scope: storage.type.buildin.array.kotlin
- match: \b(Array|Collection|List|Map|Set|MutableList|MutableMap|MutableSet|Sequence)<\b
captures:
1: storage.type.buildin.collection.kotlin
push:
- match: ">"
pop: true
- include: types
- include: keywords
- match: \w+<
push:
- match: ">"
pop: true
- include: types
- include: keywords
- match: '\{'
push:
- match: '\}'
pop: true
- include: statements
- match: \(
push:
- match: \)
pop: true
- include: types
- match: (->)
scope: keyword.operator.declaration.kotlin
variables:
- match: (?=\s*\b(?:var|val)\b)
push:
- match: (?=:|=|(\b(by)\b)|$)
pop: true
- match: \b(var|val)\b
captures:
1: keyword.other.kotlin
push:
- match: (?=:|=|(\b(by)\b)|$)
pop: true
- match: <
push:
- match: ">"
pop: true
- include: generics
- match: '([\.<\?>\w]+\.)?(\w+)'
captures:
2: entity.name.variable.kotlin
- match: (:)
captures:
1: keyword.operator.declaration.kotlin
push:
- match: (?==|$)
pop: true
- include: types
- include: getters-and-setters
- match: \b(by)\b
captures:
1: keyword.other.kotlin
push:
- match: (?=$)
pop: true
- include: expressions
- match: (=)
captures:
1: keyword.operator.assignment.kotlin
push:
- match: (?=$)
pop: true
- include: expressions
- include: getters-and-setters
Vendored Submodule
+1
Submodule assets/syntaxes/LESS added at d3ddfe7b51
+44
View File
@@ -0,0 +1,44 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Manpage
file_extensions:
- man
scope: source.man
variables:
section_heading: '^\S.*$'
contexts:
main:
- match: ^
push: first_line
first_line:
- match: '([A-Z0-9]+)(\()([^)]+)(\))'
captures:
1: meta.preprocessor
2: keyword.operator
3: string.quoted.other
4: keyword.operator
- match: '$'
push: body
body:
- match: '^(SYNOPSIS|SYNTAX|SINTASSI|SKŁADNIA|СИНТАКСИС|書式)'
push: Packages/C/C.sublime-syntax
scope: markup.heading
with_prototype:
- match: '(?={{section_heading}})'
pop: true
- match: '^\S.*$'
scope: markup.heading
- match: '\b([a-z0-9_]+)(\()([^)]*)(\))'
captures:
1: entity.name.function
2: keyword.operator
3: constant.numeric
4: keyword.operator
Vendored Submodule
+1
Submodule assets/syntaxes/Nix added at ebf06571f3
+609
View File
@@ -0,0 +1,609 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Nix
file_extensions:
- nix
scope: source.nix
contexts:
main:
- include: expression
comment:
- match: '/\*([^*]|\*[^\/])*'
push:
- meta_scope: comment.block.nix
- match: \*\/
pop: true
- include: comment-remark
- match: '\#'
push:
- meta_scope: comment.line.number-sign.nix
- match: $
pop: true
- include: comment-remark
attribute-bind:
- include: attribute-name
- include: attribute-bind-from-equals
attribute-bind-from-equals:
- match: \=
captures:
0: keyword.operator.bind.nix
push:
- match: \;
captures:
0: punctuation.terminator.bind.nix
pop: true
- include: expression
attribute-inherit:
- match: \binherit\b
captures:
0: keyword.other.inherit.nix
push:
- match: \;
captures:
0: punctuation.terminator.inherit.nix
pop: true
- match: \(
captures:
0: punctuation.section.function.arguments.nix
push:
- match: (?=\;)
pop: true
- match: \)
captures:
0: punctuation.section.function.arguments.nix
push:
- match: (?=\;)
pop: true
- include: bad-reserved
- include: attribute-name-single
- include: others
- include: expression
- match: '(?=[a-zA-Z\_])'
push:
- match: (?=\;)
pop: true
- include: bad-reserved
- include: attribute-name-single
- include: others
- include: others
attribute-name:
- match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*'
scope: entity.other.attribute-name.multipart.nix
- match: \.
- include: string-quoted
- include: interpolation
attribute-name-single:
- match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*'
scope: entity.other.attribute-name.single.nix
attrset-contents:
- include: attribute-inherit
- include: bad-reserved
- include: attribute-bind
- include: others
attrset-definition:
- match: '(?=\{)'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- match: '(\{)'
captures:
0: punctuation.definition.attrset.nix
push:
- match: '(\})'
captures:
0: punctuation.definition.attrset.nix
pop: true
- include: attrset-contents
- match: '(?<=\})'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
attrset-definition-brace-opened:
- match: '(?<=\})'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
- match: (?=.?)
push:
- match: '\}'
captures:
0: punctuation.definition.attrset.nix
pop: true
- include: attrset-contents
attrset-for-sure:
- match: (?=\brec\b)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- match: \brec\b
captures:
0: keyword.other.nix
push:
- match: '(?=\{)'
pop: true
- include: others
- include: attrset-definition
- include: others
- match: '(?=\{\s*(\}|[^,?]*(=|;)))'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: attrset-definition
- include: others
attrset-or-function:
- match: '\{'
captures:
0: punctuation.definition.attrset-or-function.nix
push:
- match: '(?=([\])};]|\b(else|then)\b))'
pop: true
- match: '(?=(\s*\}|\"|\binherit\b|\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*(\s*\.|\s*=[^=])))'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: attrset-definition-brace-opened
- match: '(?=(\.\.\.|\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*\s*[,?]))'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: function-definition-brace-opened
- include: bad-reserved
- match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*'
captures:
0: variable.parameter.function.maybe.nix
push:
- match: '(?=([\])};]|\b(else|then)\b))'
pop: true
- match: (?=\.)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: attrset-definition-brace-opened
- match: \s*(\,)
captures:
1: keyword.operator.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: function-definition-brace-opened
- match: (?=\=)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: attribute-bind-from-equals
- include: attrset-definition-brace-opened
- match: (?=\?)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: function-parameter-default
- match: \,
captures:
0: keyword.operator.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: function-definition-brace-opened
- include: others
- include: others
bad-reserved:
- match: '(?<![\w''-])(if|then|else|assert|with|let|in|rec|inherit)(?![\w''-])'
scope: invalid.illegal.reserved.nix
comment-remark:
- match: (TODO|FIXME|BUG|\!\!\!):?
captures:
1: markup.bold.comment.nix
constants:
- match: \b(builtins|true|false|null)\b
captures:
0: constant.language.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
- match: \b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\b
captures:
0: support.function.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
- match: '\b[0-9]+\b'
captures:
0: constant.numeric.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
expression:
- include: parens-and-cont
- include: list-and-cont
- include: string
- include: interpolation
- include: with-assert
- include: function-for-sure
- include: attrset-for-sure
- include: attrset-or-function
- include: let
- include: if
- include: operator-unary
- include: constants
- include: bad-reserved
- include: parameter-name-and-cont
- include: others
expression-cont:
- match: (?=.?)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: parens
- include: list
- include: string
- include: interpolation
- include: function-for-sure
- include: attrset-for-sure
- include: attrset-or-function
- match: '(\bor\b|\.|==|!=|!|\<\=|\<|\>\=|\>|&&|\|\||-\>|//|\?|\+\+|-|\*|/(?=([^*]|$))|\+)'
scope: keyword.operator.nix
- include: constants
- include: bad-reserved
- include: parameter-name
- include: others
function-body:
- match: '(@\s*([a-zA-Z\_][a-zA-Z0-9\_\''\-]*)\s*)?(\:)'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression
function-body-from-colon:
- match: (\:)
captures:
0: punctuation.definition.function.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression
function-contents:
- include: bad-reserved
- include: function-parameter
- include: others
function-definition:
- match: (?=.?)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: function-body-from-colon
- match: (?=.?)
push:
- match: (?=\:)
pop: true
- match: '(\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*)'
captures:
0: variable.parameter.function.4.nix
push:
- match: (?=\:)
pop: true
- match: \@
push:
- match: (?=\:)
pop: true
- include: function-header-until-colon-no-arg
- include: others
- include: others
- match: '(?=\{)'
push:
- match: (?=\:)
pop: true
- include: function-header-until-colon-with-arg
- include: others
function-definition-brace-opened:
- match: (?=.?)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: function-body-from-colon
- match: (?=.?)
push:
- match: (?=\:)
pop: true
- include: function-header-close-brace-with-arg
- match: (?=.?)
push:
- match: '(?=\})'
pop: true
- include: function-contents
- include: others
function-for-sure:
- match: '(?=(\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*\s*[:@]|\{[^}]*\}\s*:|\{[^#}"''/=]*[,\?]))'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: function-definition
function-header-close-brace-no-arg:
- match: '\}'
captures:
0: punctuation.definition.entity.function.nix
push:
- match: (?=\:)
pop: true
- include: others
function-header-close-brace-with-arg:
- match: '\}'
captures:
0: punctuation.definition.entity.function.nix
push:
- match: (?=\:)
pop: true
- include: function-header-terminal-arg
- include: others
function-header-open-brace:
- match: '\{'
captures:
0: punctuation.definition.entity.function.2.nix
push:
- match: '(?=\})'
pop: true
- include: function-contents
function-header-terminal-arg:
- match: (?=@)
push:
- match: (?=\:)
pop: true
- match: \@
push:
- match: (?=\:)
pop: true
- match: '(\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*)'
push:
- meta_scope: variable.parameter.function.3.nix
- match: (?=\:)
pop: true
- include: others
- include: others
function-header-until-colon-no-arg:
- match: '(?=\{)'
push:
- match: (?=\:)
pop: true
- include: function-header-open-brace
- include: function-header-close-brace-no-arg
function-header-until-colon-with-arg:
- match: '(?=\{)'
push:
- match: (?=\:)
pop: true
- include: function-header-open-brace
- include: function-header-close-brace-with-arg
function-parameter:
- match: (\.\.\.)
push:
- meta_scope: keyword.operator.nix
- match: '(,|(?=\}))'
pop: true
- include: others
- match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*'
captures:
0: variable.parameter.function.1.nix
push:
- match: '(,|(?=\}))'
captures:
0: keyword.operator.nix
pop: true
- include: whitespace
- include: comment
- include: function-parameter-default
- include: expression
- include: others
function-parameter-default:
- match: \?
captures:
0: keyword.operator.nix
push:
- match: "(?=[,}])"
pop: true
- include: expression
if:
- match: (?=\bif\b)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- match: \bif\b
captures:
0: keyword.other.nix
push:
- match: \bth(?=en\b)
captures:
0: keyword.other.nix
pop: true
- include: expression
- match: (?<=th)en\b
captures:
0: keyword.other.nix
push:
- match: \bel(?=se\b)
captures:
0: keyword.other.nix
pop: true
- include: expression
- match: (?<=el)se\b
captures:
0: keyword.other.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
captures:
0: keyword.other.nix
pop: true
- include: expression
illegal:
- match: .
scope: invalid.illegal
interpolation:
- match: '\$\{'
captures:
0: punctuation.section.embedded.begin.nix
push:
- meta_scope: markup.italic
- match: '\}'
captures:
0: punctuation.section.embedded.end.nix
pop: true
- include: expression
let:
- match: (?=\blet\b)
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- match: \blet\b
captures:
0: keyword.other.nix
push:
- match: '(?=([\])};,]|\b(in|else|then)\b))'
pop: true
- match: '(?=\{)'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- match: '\{'
push:
- match: '\}'
pop: true
- include: attrset-contents
- match: '(^|(?<=\}))'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
- include: others
- include: attrset-contents
- include: others
- match: \bin\b
captures:
0: keyword.other.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression
list:
- match: '\['
captures:
0: punctuation.definition.list.nix
push:
- match: '\]'
captures:
0: punctuation.definition.list.nix
pop: true
- include: expression
list-and-cont:
- match: '(?=\[)'
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: list
- include: expression-cont
operator-unary:
- match: (!|-)
scope: keyword.operator.unary.nix
others:
- include: whitespace
- include: comment
- include: illegal
parameter-name:
- match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*'
captures:
0: variable.parameter.name.nix
parameter-name-and-cont:
- match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*'
captures:
0: variable.parameter.name.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
parens:
- match: \(
captures:
0: punctuation.definition.expression.nix
push:
- match: \)
captures:
0: punctuation.definition.expression.nix
pop: true
- include: expression
parens-and-cont:
- match: (?=\()
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: parens
- include: expression-cont
string:
- match: (?=\'\')
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- match: \'\'
captures:
0: punctuation.definition.string.other.start.nix
push:
- meta_scope: string.quoted.other.nix
- match: \'\'(?!\$|\'|\\.)
captures:
0: punctuation.definition.string.other.end.nix
pop: true
- match: \'\'(\$|\'|\\.)
scope: constant.character.escape.nix
- include: interpolation
- include: expression-cont
- match: (?=\")
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: string-quoted
- include: expression-cont
- match: '([a-zA-Z0-9\.\_\-\+]*(\/[a-zA-Z0-9\.\_\-\+]+)+)'
captures:
0: string.unquoted.path.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
- match: '(\<[a-zA-Z0-9\.\_\-\+]+(\/[a-zA-Z0-9\.\_\-\+]+)*\>)'
captures:
0: string.unquoted.spath.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
- match: '([a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\'']+)'
captures:
0: string.unquoted.url.nix
push:
- match: '(?=([\])};,]|\b(else|then)\b))'
pop: true
- include: expression-cont
string-quoted:
- match: \"
captures:
0: punctuation.definition.string.double.start.nix
push:
- meta_scope: string.quoted.double.nix
- match: \"
captures:
0: punctuation.definition.string.double.end.nix
pop: true
- match: \\.
scope: constant.character.escape.nix
- include: interpolation
whitespace:
- match: \s+
with-assert:
- match: '(?<![\w''-])(with|assert)(?![\w''-])'
captures:
0: keyword.other.nix
push:
- match: \;
pop: true
- include: expression
Vendored Submodule
+1
+219
View File
@@ -0,0 +1,219 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: orgmode
file_extensions:
- org
scope: text.orgmode
contexts:
main:
- match: |-
(?x)
^(\*+) # leading stars
\s*([A-Z_]{2,})? # todo keywords
\s*(\[\#[A-Ca-c]\])? # priority
\s*(?=\s+[A-Za-z0-9]+) # expected heading text
comment: Outline headings
captures:
1: punctuation.definition.heading.orgmode
2: keyword.other.todo.orgmode
3: constant.other.priority.orgmode
push:
- meta_scope: markup.heading.orgmode
- meta_content_scope: entity.name.section.orgmode
- match: (?=\s*$\n?)
pop: true
- include: heading-inline
- match: "^-{5,}$"
scope: meta.separator.orgmode
- match: '^\s*([-+]|\s+\*)\s+(.*?)\s+::'
captures:
1: keyword.operator.list.orgmode
2: markup.bold.definition.orgmode
push:
- meta_scope: meta.list.definition.orgmode
- match: $
pop: true
- include: inline
- match: '^\s*?([-+]|\s+\*|\d+[).])'
captures:
1: keyword.operator.list.orgmode
push:
- meta_scope: meta.list.plain.orgmode
- match: $
pop: true
- include: list-inline
- match: (?i)^#\+(BEGIN_(QUOTE|VERSE|CENTER))$
captures:
1: keyword.control.block.orgmode
push:
- meta_scope: markup.quote.orgmode
- match: (?i)^#\+(END_\2)$
captures:
1: keyword.control.block.orgmode
pop: true
- match: "^#[^+].*$"
scope: comment.line.number-sign.orgmode
- match: ^:(PROPERTIES):$
captures:
1: keyword.control.drawer.orgmode
push:
- meta_scope: meta.drawer.properties.orgmode
- match: ^:(END):$
captures:
1: keyword.control.drawer.orgmode
pop: true
- include: properties
- match: ^:(.+):$
captures:
1: keyword.control.drawer.orgmode
push:
- meta_scope: meta.drawer.other.orgmode
- match: ^:(END):$
captures:
1: keyword.control.drawer.orgmode
pop: true
- match: (?i)#\+(BEGIN_LaTeX)$
captures:
1: keyword.control.block.orgmode
push:
- meta_scope: meta.block.latex.orgmode
- match: (?i)#\+(END_LaTeX)$
captures:
1: keyword.control.block.orgmode
pop: true
- include: scope:text.tex.latex
- match: (?i)#\+(BEGIN_HTML)$
captures:
1: keyword.control.block.orgmode
push:
- meta_scope: meta.block.html.orgmode
- match: (?i)#\+(END_HTML)$
captures:
1: keyword.control.block.orgmode
pop: true
- include: scope:text.html.basic
- match: (?i)#\+(BEGIN_SRC)\s+(python)\s*(.*)$
captures:
1: keyword.control.block.orgmode
2: constant.other.language.orgmode
3: string.other.header-args.orgmode
push:
- meta_scope: meta.block.source.python.orgmode
- match: (?i)#\+(END_SRC)$
captures:
1: keyword.control.block.orgmode
pop: true
- include: scope:source.python
- match: (?i)#\+(BEGIN_SRC)\s+(ruby)\s*(.*)$
captures:
1: keyword.control.block.orgmode
2: constant.other.language.orgmode
3: string.other.header-args.orgmode
push:
- meta_scope: meta.block.source.ruby.orgmode
- match: (?i)#\+(END_SRC)$
captures:
1: keyword.control.block.orgmode
pop: true
- include: scope:source.ruby
- match: (?i)#\+(BEGIN_SRC)\s+((?:emacs-)?lisp)\s*(.*)$
captures:
1: keyword.control.block.orgmode
2: constant.other.language.orgmode
3: string.other.header-args.orgmode
push:
- meta_scope: meta.block.source.lisp.orgmode
- match: (?i)#\+(END_SRC)$
captures:
1: keyword.control.block.orgmode
pop: true
- include: scope:source.lisp
- match: (?i)#\+(BEGIN_SRC)\s+(sh)\s*(.*)$
captures:
1: keyword.control.block.orgmode
2: constant.other.language.orgmode
3: string.other.header-args.orgmode
push:
- meta_scope: meta.block.source.shell.orgmode
- match: (?i)#\+(END_SRC)$
captures:
1: keyword.control.block.orgmode
pop: true
- include: scope:source.shell
- match: '(?i)#\+(BEGIN_(SRC|EXAMPLE))(?:\s+([\w-]+)?\s*(.*))?$'
captures:
1: keyword.control.block.orgmode
3: constant.other.language.orgmode
4: string.other.header-args.orgmode
push:
- meta_scope: meta.block.source.other.orgmode
- meta_content_scope: markup.raw.block.orgmode
- match: (?i)#\+(END_\2)$
captures:
1: keyword.control.block.orgmode
pop: true
- match: '#\+(OPTIONS):'
captures:
1: keyword.control.pragma.orgmode
push:
- meta_scope: meta.pragma.options.orgmode
- match: $
pop: true
- match: '([^\s]+):([^\s]+)'
scope: meta.option.orgmode
captures:
1: variable.parameter.option.orgmode
2: string.other.option.orgmode
- match: '#\+(CALL):\s+[A-Za-z-]+(?:\[([^\]]*)\])?\(?'
captures:
1: keyword.control.pragma.orgmode
2: string.other.header-args.orgmode
push:
- meta_scope: meta.pragma.call.orgmode
- match: '\)?([^)]*)$'
captures:
1: string.other.header-args.orgmode
pop: true
- match: (\w+)=
scope: meta.assignment.orgmode
captures:
1: variable.parameter.header-args.orgmode
- match: '^#\+([a-zA-Z_-]+): ?(.*)$'
scope: meta.pragma.orgmode
captures:
1: keyword.control.pragma.orgmode
2: string.unquoted.pragma.orgmode
- include: inline
heading-inline:
- match: ':([^:^\s]*)(?=:)'
scope: meta.keyword.orgmode
captures:
1: string.quoted.keyword.orgmode
- include: inline
inline:
- match: '(?<=^|[.,:;\s])/[^/]+/(?=$|[.,:;\s])'
scope: markup.italic.orgmode
- match: '(?<=^|[.,:;\s])\*[^*]+\*(?=$|[.,:;\s])'
scope: markup.bold.orgmode
- match: '(?<=^|[.,:;\s])_[^_]+_(?=$|[.,:;\s])'
scope: markup.underline.orgmode
- match: '(?<=^|[.,:;\s])([~=]).+?\1(?=$|[.,:;\s])'
scope: markup.raw.inline.orgmode
- match: '\[(?:\[([^\]]*)\])?\[([^\]]*)\]\]'
scope: meta.link.orgmode
captures:
1: markup.underline.link.orgmode
2: string.other.link.orgmode
- match: (?:http|ftp)s?:\/\/\S+
scope: markup.underline.url.orgmode
list-inline:
- match: '\[[ -X]\]'
scope: keyword.operator.checkbox.orgmode
- include: inline
properties:
- match: '^:([A-Za-z_]+):\s(.*)$'
scope: meta.property.orgmode
captures:
1: keyword.control.property.orgmode
2: string.unquoted.propval.orgmode
Vendored Submodule
+1
Vendored Submodule
+1
+466
View File
@@ -0,0 +1,466 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: PowerShell
file_extensions:
- ps1
- psm1
- psd1
scope: source.powershell
contexts:
main:
- match: "<#"
captures:
0: punctuation.definition.comment.block.begin.powershell
push:
- meta_scope: comment.block.powershell
- match: "#>"
captures:
0: punctuation.definition.comment.block.end.powershell
pop: true
- include: commentEmbeddedDocs
- match: '[2-6]>&1|>>|>|<<|<|>|>\||[1-6]>|[1-6]>>'
scope: keyword.operator.redirection.powershell
- include: commands
- include: commentLine
- include: variable
- include: interpolatedStringContent
- include: function
- include: attribute
- include: UsingDirective
- include: type
- include: hashtable
- include: doubleQuotedString
- include: scriptblock
- include: doubleQuotedStringEscapes
- match: (?<!')'
captures:
0: punctuation.definition.string.begin.powershell
push:
- meta_scope: string.quoted.single.powershell
- match: "'(?!')"
captures:
0: punctuation.definition.string.end.powershell
pop: true
- match: "''"
scope: constant.character.escape.powershell
- match: \@"(?=$)
push:
- meta_scope: string.quoted.double.heredoc.powershell
- match: ^"@
pop: true
- include: variableNoProperty
- include: doubleQuotedStringEscapes
- include: interpolation
- match: \@'(?=$)
push:
- meta_scope: string.quoted.single.heredoc.powershell
- match: ^'@
pop: true
- match: "''"
scope: constant.character.escape.powershell
- include: numericConstant
- match: (@)(\()
captures:
1: keyword.other.array.begin.powershell
2: punctuation.section.group.begin.powershell
push:
- meta_scope: meta.group.array-expression.powershell
- match: \)
captures:
0: punctuation.section.group.end.powershell
pop: true
- include: main
- match: (\$)(\()
comment: "TODO: move to repo; make recursive."
captures:
1: punctuation.definition.variable.powershell
2: punctuation.section.group.begin.powershell
push:
- meta_scope: meta.group.complex.subexpression.powershell
- match: \)
captures:
0: punctuation.section.group.end.powershell
pop: true
- include: main
- match: '(\b(([A-Za-z0-9\-_\.]+)\.(?i:exe|com|cmd|bat))\b)'
scope: support.function.powershell
- match: (?<!\w|-|\.)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|sequence|switch|throw|trap|try|until|var|while)|%|\?)(?!\w)
scope: keyword.control.powershell
- match: '(?<!\w|-|[^\)]\.)((?i:(foreach|where)(?!-object))|%|\?)(?!\w)'
scope: keyword.control.powershell
- match: (?<!\w)(--%)(?!\w)
comment: This should be moved to the repository at some point.
captures:
1: keyword.control.powershell
push:
- match: $
pop: true
- match: .+
scope: string.unquoted.powershell
- match: (?<!\w)((?i:hidden|static))(?!\w)
comment: This should only be relevant inside a class but will require a rework of how classes are matched. This is a temp fix.
scope: storage.modifier.powershell
- match: '(?<!\w|-)((?i:class)|%|\?)(?:\s)+((?:\p{L}|\d|_|-|)+)\b'
comment: capture should be entity.name.type, but it doesn't provide a good color in the default schema.
captures:
1: storage.type.powershell
2: entity.name.function
- match: (?<!\w)-(?i:is(?:not)?|as)\b
scope: keyword.operator.comparison.powershell
- match: '(?<!\w)-(?i:[ic]?(?:eq|ne|[gl][te]|(?:not)?(?:like|match|contains|in)|replace))(?!\p{L})'
scope: keyword.operator.comparison.powershell
- match: '(?<!\w)-(?i:join|split)(?!\p{L})|!'
scope: keyword.operator.unary.powershell
- match: '(?<!\w)-(?i:and|or|not|xor)(?!\p{L})|!'
scope: keyword.operator.logical.powershell
- match: '(?<!\w)-(?i:band|bor|bnot|bxor|shl|shr)(?!\p{L})'
scope: keyword.operator.bitwise.powershell
- match: '(?<!\w)-(?i:f)(?!\p{L})'
scope: keyword.operator.string-format.powershell
- match: "[+%*/-]?=|[+/*%-]"
scope: keyword.operator.assignment.powershell
- match: '\|{2}|&{2}|;'
scope: punctuation.terminator.statement.powershell
- match: '&|(?<!\w)\.(?= )|`|,|\|'
scope: keyword.operator.other.powershell
- match: (?<!\s|^)\.\.(?=\-?\d|\(|\$)
comment: This is very imprecise, is there a syntax for 'must come after...'
scope: keyword.operator.range.powershell
RequiresDirective:
- match: (?<=#)(?i:(requires))\s
captures:
0: keyword.control.requires.powershell
push:
- meta_scope: meta.requires.powershell
- match: $
pop: true
- match: \-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version)
scope: keyword.other.powershell
- match: '(?<!-)\b\p{L}+|\d+(?:\.\d+)*'
scope: variable.parameter.powershell
- include: hashtable
UsingDirective:
- match: (?<!\w)(?i:(using))\s+(?i:(namespace|module))\s+(?i:((?:\w+(?:\.)?)+))
captures:
1: keyword.control.using.powershell
2: keyword.other.powershell
3: variable.parameter.powershell
attribute:
- match: '(\[)\s*\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\b'
captures:
1: punctuation.section.bracket.begin.powershell
2: support.function.attribute.powershell
push:
- meta_scope: meta.attribute.powershell
- match: '(\])'
captures:
1: punctuation.section.bracket.end.powershell
pop: true
- match: \(
captures:
0: punctuation.section.group.begin.powershell
push:
- match: \)
captures:
0: punctuation.section.group.end.powershell
pop: true
- include: variable
- include: variableNoProperty
- include: hashtable
- include: scriptblock
- include: doubleQuotedStringEscapes
- include: doubleQuotedString
- include: type
- include: numericConstant
- include: doubleQuotedString
- include: main
- match: (?i)\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|supportspaging|positionalbinding|helpuri|confirmimpact|helpmessage)\b(?:\s+)?(=)?
captures:
1: variable.parameter.attribute.powershell
2: keyword.operator.assignment.powershell
- match: (?<!')'
captures:
0: punctuation.definition.string.begin.powershell
push:
- meta_scope: string.quoted.single.powershell
- match: "'(?!')"
captures:
0: punctuation.definition.string.end.powershell
pop: true
- match: "''"
scope: constant.character.escape.powershell
commands:
- match: '(?:(\p{L}|\d|_|-|\\|\:)*\\)?\b(?i:Add|Approve|Assert|Backup|Block|Build|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Deploy|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write)\-.+?(?:\.(?i:exe|cmd|bat|ps1))?\b'
comment: "Verb-Noun pattern:"
scope: support.function.powershell
- match: (?<!\w)(?i:foreach-object)(?!\w)
comment: Builtin cmdlets with reserved verbs
scope: support.function.powershell
- match: (?<!\w)(?i:where-object)(?!\w)
comment: Builtin cmdlets with reserved verbs
scope: support.function.powershell
- match: (?<!\w)(?i:sort-object)(?!\w)
comment: Builtin cmdlets with reserved verbs
scope: support.function.powershell
- match: (?<!\w)(?i:tee-object)(?!\w)
comment: Builtin cmdlets with reserved verbs
scope: support.function.powershell
commentEmbeddedDocs:
- match: ^(?i:(?:\s?|#)+(\.)(COMPONENT|DESCRIPTION|EXAMPLE|EXTERNALHELP|FORWARDHELPCATEGORY|FORWARDHELPTARGETNAME|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|REMOTEHELPRUNSPACE|ROLE|SYNOPSIS))
scope: comment.documentation.embedded.powershell
captures:
1: constant.string.documentation.powershell
2: keyword.operator.documentation.powershell
- match: '(?i:\s?(\.)(PARAMETER|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP)\s+([a-z0-9-_]+))'
scope: comment.documentation.embedded.powershell
captures:
1: constant.string.documentation.powershell
2: keyword.operator.documentation.powershell
3: keyword.operator.documentation.powershell
commentLine:
- match: '(?<![`\\-])#'
captures:
0: punctuation.definition.comment.powershell
push:
- meta_scope: comment.line.powershell
- match: $\n?
captures:
0: punctuation.definition.comment.powershell
pop: true
- include: commentEmbeddedDocs
- include: RequiresDirective
doubleQuotedString:
- match: (?<!(?<!`)")"
captures:
0: punctuation.definition.string.begin.powershell
push:
- meta_scope: string.quoted.double.powershell
- match: '"(?!")'
captures:
0: punctuation.definition.string.end.powershell
pop: true
- match: '(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,64}\b'
- include: variableNoProperty
- include: variable
- include: doubleQuotedStringEscapes
- include: interpolation
- match: '`\s*$'
scope: keyword.other.powershell
doubleQuotedStringEscapes:
- match: '`[0abnfrvt"''$`]'
scope: constant.character.escape.powershell
- match: '""'
scope: constant.character.escape.powershell
function:
- match: '^(?:\s*+)(?i)(function|filter|configuration|workflow)\s+(?:(global|local|script|private):)?((?:\p{L}|\d|_|-|\.)+)'
captures:
0: meta.function.powershell
1: storage.type.powershell
2: storage.modifier.scope.powershell
3: entity.name.function.powershell
push:
- match: '(?=\{|\()'
pop: true
- include: commentLine
hashtable:
- match: '(@)(\{)'
captures:
1: keyword.other.hashtable.begin.powershell
2: punctuation.section.braces.begin.powershell
push:
- meta_scope: meta.hashtable.powershell
- match: '(\})'
captures:
1: punctuation.section.braces.end.powershell
pop: true
- match: \b((?:\'|\")?)(\w+)((?:\'|\")?)(?:\s+)?(=)(?:\s+)?
scope: meta.hashtable.assignment.powershell
captures:
1: punctuation.definition.string.begin.powershell
2: variable.other.readwrite.powershell
3: punctuation.definition.string.end.powershell
4: keyword.operator.assignment.powershell
- include: scriptblock
- include: main
interpolatedStringContent:
- match: \(
captures:
0: punctuation.section.group.begin.powershell
push:
- meta_content_scope: interpolated.simple.source.powershell
- match: \)
captures:
0: punctuation.section.group.end.powershell
pop: true
- include: main
- include: interpolation
- include: interpolatedStringContent
interpolation:
- match: (\$)(\()
captures:
1: punctuation.definition.variable.powershell
2: punctuation.section.group.begin.powershell
push:
- meta_content_scope: interpolated.complex.source.powershell
- match: \)
captures:
0: punctuation.section.group.end.powershell
pop: true
- include: main
- include: interpolation
- include: interpolatedStringContent
numericConstant:
- match: '(?<!\w)([-+]?0(?:x|X)[0-9a-fA-F_]+(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\b'
captures:
1: constant.numeric.hex.powershell
2: keyword.other.powershell
- match: '(?<!\w)([-+]?(?:[0-9_]+)?\.[0-9_]+(?:(?:e|E)[0-9]+)?(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\b'
captures:
1: constant.numeric.integer.powershell
2: keyword.other.powershell
- match: '(?<!\w)([-+]?0(?:b|B)[01_]+(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\b'
captures:
1: constant.numeric.octal.powershell
2: keyword.other.powershell
- match: '(?<!\w)([-+]?[0-9_]+(?:e|E)(?:[0-9_])?+(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\b'
captures:
1: constant.numeric.integer.powershell
2: keyword.other.powershell
- match: '(?<!\w)([-+]?[0-9_]+\.(?:e|E)(?:[0-9_])?+(?:F|f|D|d|M|m)?)((?i:[kmgtp]b)?)\b'
captures:
1: constant.numeric.integer.powershell
2: keyword.other.powershell
- match: '(?<!\w)([-+]?[0-9_]+[\.]?(?:F|f|D|d|M|m))((?i:[kmgtp]b)?)\b'
captures:
1: constant.numeric.integer.powershell
2: keyword.other.powershell
- match: '(?<!\w)([-+]?[0-9_]+[\.]?(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\b'
captures:
1: constant.numeric.integer.powershell
2: keyword.other.powershell
scriptblock:
- match: '\{'
captures:
0: punctuation.section.braces.begin.powershell
push:
- meta_scope: meta.scriptblock.powershell
- match: '\}'
captures:
0: punctuation.section.braces.end.powershell
pop: true
- include: main
type:
- match: '\['
captures:
0: punctuation.section.bracket.begin.powershell
push:
- match: '\]'
captures:
0: punctuation.section.bracket.end.powershell
pop: true
- match: '(?!\d+|\.)(?:\p{L}|\p{N}|\.)+'
scope: storage.type.powershell
- include: main
variable:
- match: (\$)(?i:(False|Null|True))\b
comment: These are special constants.
captures:
0: constant.language.powershell
1: punctuation.definition.variable.powershell
- match: '(\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))((?:\.(?:\p{L}|\d|_)+)*\b)?\b'
comment: These are the other built-in constants.
captures:
0: support.constant.variable.powershell
1: punctuation.definition.variable.powershell
3: variable.other.member.powershell
- match: '(\$)(?i:(\$|\^|\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))((?:\.(?:\p{L}|\d|_)+)*\b)?\b'
comment: Automatic variables are not constants, but they are read-only. In monokai (default) color schema support.variable doesn't have color, so we use constant.
captures:
0: support.constant.automatic.powershell
1: punctuation.definition.variable.powershell
3: variable.other.member.powershell
- match: '(\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))((?:\.(?:\p{L}|\d|_)+)*\b)?\b'
comment: Style preference variables as language variables so that they stand out.
captures:
0: variable.language.powershell
1: punctuation.definition.variable.powershell
3: variable.other.member.powershell
- match: '(?i:(\$|@)(global|local|private|script|using|workflow):((?:\p{L}|\d|_)+))((?:\.(?:\p{L}|\d|_)+)*\b)?'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: storage.modifier.scope.powershell
4: variable.other.member.powershell
- match: '(?i:(\$)(\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\}))((?:\.(?:\p{L}|\d|_)+)*\b)?'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: punctuation.section.braces.begin.powershell
3: storage.modifier.scope.powershell
5: punctuation.section.braces.end.powershell
6: variable.other.member.powershell
- match: '(?i:(\$|@)((?:\p{L}|\d|_)+:)?((?:\p{L}|\d|_)+))((?:\.(?:\p{L}|\d|_)+)*\b)?'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: support.variable.drive.powershell
4: variable.other.member.powershell
- match: '(?i:(\$)(\{)((?:\p{L}|\d|_)+:)?([^}]*[^}`])(\}))((?:\.(?:\p{L}|\d|_)+)*\b)?'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: punctuation.section.braces.begin.powershell
3: support.variable.drive.powershell
5: punctuation.section.braces.end.powershell
6: variable.other.member.powershell
variableNoProperty:
- match: (\$)(?i:(False|Null|True))\b
comment: These are special constants.
captures:
0: constant.language.powershell
1: punctuation.definition.variable.powershell
- match: (\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))\b
comment: These are the other built-in constants.
captures:
0: support.constant.variable.powershell
1: punctuation.definition.variable.powershell
3: variable.other.member.powershell
- match: (\$)(?i:(\$|\^|\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))\b
comment: Automatic variables are not constants, but they are read-only...
captures:
0: support.variable.automatic.powershell
1: punctuation.definition.variable.powershell
3: variable.other.member.powershell
- match: (\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))\b
comment: Style preference variables as language variables so that they stand out.
captures:
0: variable.language.powershell
1: punctuation.definition.variable.powershell
3: variable.other.member.powershell
- match: '(?i:(\$|@)(global|local|private|script|using|workflow):((?:\p{L}|\d|_)+))'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: storage.modifier.scope.powershell
4: variable.other.member.powershell
- match: '(?i:(\$)(\{)(global|local|private|script|using|workflow):([^}]*[^}`])(\}))'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: storage.modifier.scope.powershell
4: keyword.other.powershell
5: variable.other.member.powershell
- match: '(?i:(\$)((?:\p{L}|\d|_)+:)?((?:\p{L}|\d|_)+))'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: support.variable.drive.powershell
4: variable.other.member.powershell
- match: '(?i:(\$)(\{)((?:\p{L}|\d|_)+:)?([^}]*[^}`])(\}))'
captures:
0: variable.other.readwrite.powershell
1: punctuation.definition.variable.powershell
2: punctuation.section.braces.begin
3: support.variable.drive.powershell
5: punctuation.section.braces.end
Vendored Submodule
+1
Vendored Submodule
+1
Submodule assets/syntaxes/Puppet added at 2a224343d2
Vendored Submodule
+1
Vendored Submodule
+1
Submodule assets/syntaxes/Robot added at 8e5a349a3e
+54
View File
@@ -0,0 +1,54 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Robot Framework syntax highlighting.
file_extensions:
- robot
scope: source.robot
contexts:
main:
- match: '\$\{(\d+|\d+\.\d*|0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+)\}'
comment: "Robot Framework numbers, like ${1} or ${12.3}"
scope: constant.numeric.robot
- match: '(?i)(%\{[\w|\s]+\})'
comment: "Robot Framework environment variable, like %{USER}"
scope: variable.parameter.robot
- match: '((?<!\\)|(?<=\\\\))[$&]{'
comment: Robot Framework scalar and dictionary variables
push:
- meta_scope: entity.name.class
- match: '\}'
pop: true
- match: '((?<!\\)(@{)|(?<=\\\\)(@{))'
comment: Robot Framework list variables
push:
- meta_scope: entity.name.class
- match: '(}\[.+])|(})'
pop: true
- match: '(?i)^(\|\s*)?(\*{1,3} ?)(settings?|variables?|keywords?|test cases?)( ?\*{1,3})?(\s*\|)?'
comment: Robot Framework data tables
scope: string.robot.header
- match: '(?i)(^\|\s*)?\[?Documentation\]?\s+'
comment: Test case, keyword and settings table documentation
push:
- meta_scope: comment
- match: ^(?!\s*+\.\.\.)
pop: true
- match: '(^| {2,}|\t|\\| {1,})(?<!\\\\)#'
comment: Comment character
push:
- meta_scope: comment
- match: $
pop: true
- match: '(?i)\s+\[(Tags|Setup|Teardown|Template|Timeout|Arguments|Return)\]'
comment: Tests case and keyword settings
scope: storage.type
- match: (?i)^(\|\s*)?(Library|Resource|Test Timeout|Test Template|Test Teardown|Test Setup|Default Tags|Force Tags|Metadata|Variables|Suite Setup|Suite Teardown)(?:( )|( \| ))
comment: Settings table settings, like Library
scope: constant.language
- match: '^(\|\s+)?(?!^\.{3})(?![\|$&])\S+'
comment: Keywords and test cases
push:
- meta_scope: keyword.control.robot
- match: '($|\||\s{2,})'
pop: true
Vendored Submodule
+1
Vendored Submodule
+1
Submodule assets/syntaxes/Strace added at 3ec51e0bca
Vendored Submodule
+1
Submodule assets/syntaxes/Swift added at fef17119ce
+371
View File
@@ -0,0 +1,371 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Swift
file_extensions:
- swift
first_line_match: ^#!/.*\bswift
scope: source.swift
contexts:
main:
- include: shebang-line
- include: comment
- include: attribute
- include: literal
- include: operator
- include: declaration
- include: storage-type
- include: keyword
- include: type
- include: boolean
comment:
- include: documentation-comment
- include: block-comment
- include: in-line-comment
access-level-modifier:
- match: \b(open|public|internal|fileprivate|private)\b(?:\(set\))?
comment: access-level-modifier
scope: keyword.other.access-level-modifier.swift
arithmetic-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])(\+|\-|\*|\/)(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.arithmetic.swift
array-type:
- match: \b(Array)(<)
captures:
1: support.type.array.swift
2: punctuation.array.begin.swift
push:
- meta_scope: meta.array.swift
- match: (>)
captures:
1: punctuation.array.end.swift
pop: true
- include: main
assignment-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])(\+|\-|\*|\/|%|<<|>>|&|\^|\||&&|\|\|)?=(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.assignment.swift
attribute:
- match: '((@)(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B))(\()'
captures:
1: storage.modifier.attribute.swift
2: punctuation.definition.attribute.swift
3: punctuation.definition.attribute-arguments.begin.swift
push:
- meta_content_scope: meta.attribute.arguments.swift
- match: \)
captures:
0: punctuation.definition.attribute-arguments.end.swift
pop: true
- include: main
- match: '((@)(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B))'
captures:
1: storage.modifier.attribute.swift
2: punctuation.definition.attribute.swift
bitwise-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])(&|\||\^|<<|>>)(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.bitwise.swift
block-comment:
- match: /\*
comment: Block comment
captures:
0: punctuation.definition.comment.block.begin.swift
push:
- meta_scope: comment.block.swift
- match: \*/
captures:
0: punctuation.definition.comment.block.end.swift
pop: true
boolean:
- match: \b(true|false)\b
scope: keyword.constant.boolean.swift
branch-statement-keyword:
- include: if-statement-keyword
- include: switch-statement-keyword
catch-statement-keyword:
- match: \b(catch|do)\b
comment: catch-statement
scope: kewyord.control.catch.swift
code-block:
- match: '(\{)'
comment: code-block
captures:
1: punctuation.definition.code-block.begin.swift
push:
- match: '(\})'
captures:
1: punctuation.definition.code-block.end.swift
pop: true
- include: main
collection-type:
- include: array-type
- include: dictionary-type
- match: \b(Array|Dictionary)\b
scope: support.type.swift
comparative-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])((=|!)==?|(<|>)=?|~=)(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.comparative.swift
control-transfer-statement-keyword:
- match: \b(continue|break|fallthrough|return)\b
comment: control-transfer-statement
scope: keyword.control.transfer.swift
custom-operator:
- match: '(?<=[\s(\[{,;:])([/=\-+!*%<>&|\^~.]++)(?![\s)\]},;:])'
scope: keyword.operator.custom.prefix.unary.swift
- match: '(?<![\s(\[{,;:])([/=\-+!*%<>&|\^~.]++)(?![\s)\]},;:\.])'
scope: keyword.operator.custom.postfix.unary.swift
- match: '(?<=[\s(\[{,;:])([/=\-+!*%<>&|\^~.]++)(?=[\s)\]},;:])'
scope: keyword.operator.custom.binary.swift
declaration:
- include: import-declaration
- include: function-declaration
declaration-modifier:
- match: \b(class|convenience|dynamic|final|lazy|(non)?mutating|optional|override|required|static|unowned((un)?safe)?|weak)\b
comment: declaration-modifier
scope: keyword.other.declaration-modifier.swift
dictionary-type:
- match: \b(Dictionary)(<)
captures:
1: support.type.dictionary.swift
2: punctuation.dictionary.begin.swift
push:
- meta_scope: meta.dictionary.swift
- match: (>)
captures:
1: punctuation.dictionary.end.swift
pop: true
- include: main
documentation-comment:
- match: /\*\*
comment: Documentation comment
captures:
0: punctuation.definition.comment.block.documentation.begin.swift
push:
- meta_scope: comment.block.documentation.swift
- match: \*/
captures:
0: punctuation.definition.comment.block.documentation.end.swift
pop: true
floating-point-literal:
- match: '\b([0-9][0-9_]*)(\.([0-9][0-9_]*))?([eE][+\-]?([0-9][0-9_]*))?\b'
comment: floating-point-literal -> (decimal-literal)(decimal-fraction)?(decimal-exponent)?
- match: '\b(0x\h[\h_]*)(\.(0x\h[\h_]*))?([pP][+\-]?(0x\h[\h_]*))\b'
comment: floating-point-literal -> (hexadecimal-literal)(hexadecimal-fraction)?(hexadecimal-exponent)
function-body:
- include: code-block
function-declaration:
- match: '\b(func)\s+(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B|[/=\-+!*%<>&|\^~.]+)\s*(?=\(|<)'
comment: function-declaration
captures:
1: storage.type.function.swift
2: entity.type.function.swift
push:
- meta_scope: meta.function-declaration.swift
- match: '(?<=\})'
pop: true
- include: generic-parameter-clause
- include: parameter-clause
- include: function-result
- include: function-body
function-result:
- match: '(?<![/=\-+!*%<>&|\^~.])(\->)(?![/=\-+!*%<>&|\^~.])\s*'
comment: function-result
captures:
1: keyword.operator.function-result.swift
push:
- meta_scope: meta.function-result.swift
- match: '\s*(?=\{)'
pop: true
- include: type
generic-parameter-clause:
- match: (<)
comment: generic-parameter-clause
captures:
1: punctuation.definition.generic-parameter-clause.begin.swift
push:
- meta_scope: meta.generic-parameter-clause.swift
- match: (>)
captures:
1: punctuation.definition.generic-parameter-clause.end.swift
pop: true
- include: main
identifier:
- match: '(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B)'
comment: identifier
scope: meta.identifier.swift
if-statement-keyword:
- match: \b(if|else)\b
comment: if-statement
scope: keyword.control.if.swift
import-declaration:
- match: '\b(import)\s+(?:(typealias|struct|class|enum|protocol|var|func)\s+)?((?:\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B|[/=\-+!*%<>&|\^~.]+)(?:\.(?:\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B|[/=\-+!*%<>&|\^~.]+))*)'
comment: import-declaration
scope: meta.import.swift
captures:
1: keyword.other.import.swift
2: storage.modifier.swift
3: support.type.module.import.swift
in-line-comment:
- match: (//).*
comment: In-line comment
scope: comment.line.double-slash.swift
captures:
1: punctuation.definition.comment.line.double-slash.swift
increment-decrement-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])(\+\+|\-\-)(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.increment-or-decrement.swift
integer-literal:
- match: '(\B\-|\b)(0b[01][01_]*)\b'
comment: binary-literal
scope: constant.numeric.integer.binary.swift
- match: '(\B\-|\b)(0o[0-7][0-7_]*)\b'
comment: octal-literal
scope: constant.numeric.integer.octal.swift
- match: '(\B\-|\b)([0-9][0-9_]*)\b'
comment: decimal-literal
scope: constant.numeric.integer.decimal.swift
- match: '(\B\-|\b)(0x\h[\h_]*)\b'
comment: hexadecimal-literal
scope: constant.numeric.integer.hexadecimal.swift
integer-type:
- match: \bU?Int(8|16|32|64)?\b
comment: Int types
scope: support.type.swift
keyword:
- include: branch-statement-keyword
- include: control-transfer-statement-keyword
- include: loop-statement-keyword
- include: catch-statement-keyword
- include: operator-declaration-modifier
- include: declaration-modifier
- include: access-level-modifier
- match: \b(class|deinit|enum|extension|func|import|init|let|protocol|static|struct|subscript|typealias|var|throws|rethrows)\b
comment: declaration keyword
scope: keyword.declaration.swift
- match: \b(break|case|continue|default|do|else|fallthrough|if|in|for|return|switch|where|while|repeat|catch|guard|defer|try|throw)\b
comment: statement keyword
scope: keyword.statement.swift
- match: \b(as|dynamicType|is|new|super|self|Self|Type)\b
comment: expression and type keyword
scope: keyword.other.statement.swift
- match: \b(associativity|didSet|get|infix|inout|left|mutating|none|nonmutating|operator|override|postfix|precedence|prefix|right|set|unowned((un)?safe)?|weak|willSet)\b
comment: other keyword
scope: keyword.other.swift
literal:
- include: integer-literal
- include: floating-point-literal
- include: nil-literal
- include: string-literal
- include: special-literal
logical-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])(!|&&|\|\|)(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.logical.swift
loop-statement-keyword:
- match: \b(while|repeat|for|in)\b
comment: loop-statement
scope: keyword.control.loop.swift
nil-literal:
- match: \bnil\b
comment: nil-literal
scope: constant.nil.swift
operator:
- include: comparative-operator
- include: assignment-operator
- include: logical-operator
- include: remainder-operator
- include: increment-decrement-operator
- include: overflow-operator
- include: range-operator
- include: bitwise-operator
- include: arithmetic-operator
- include: ternary-operator
- include: type-casting-operator
- include: custom-operator
operator-declaration-modifier:
- match: \b(operator|prefix|infix|postfix)\b
comment: operator-declaration
scope: keyword.other.operator.swift
optional-type:
- match: \b(Optional)(<)
scope: meta.optional.swift
overflow-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])\&(\+|\-|\*|\/|%)(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.overflow.swift
parameter-clause:
- match: (\()
comment: parameter-clause
captures:
1: punctuation.definition.function-arguments.begin.swift
push:
- meta_scope: meta.parameter-clause.swift
- match: (\))
captures:
1: punctuation.definition.function-arguments.end.swift
pop: true
- include: main
primitive-type:
- match: \b(Int|Float|Double|String|Bool|Character|Void)\b
comment: Primitive types
scope: support.type.swift
protocol-composition-type:
- match: \b(protocol)(<)
scope: meta.protocol.swift
range-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])\.\.(?:\.)?(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.range.swift
remainder-operator:
- match: '(?<![/=\-+!*%<>&|\^~.])\%(?![/=\-+!*%<>&|\^~.])'
scope: keyword.operator.remainder.swift
shebang-line:
- match: ^(#!).*$
comment: Shebang line
scope: comment.line.shebang.swift
captures:
1: punctuation.definition.comment.line.shebang.swift
special-literal:
- match: \b__(FILE|LINE|COLUMN|FUNCTION)__\b
scope: keyword.other.literal.swift
storage-type:
- match: \b(var|func|let|class|enum|struct|protocol|extension|typealias)\b
scope: storage.type.swift
string-literal:
- match: \"
captures:
0: string.quoted.double.swift
push:
- meta_scope: meta.literal.string.swift
- match: \"
captures:
0: string.quoted.double.swift
pop: true
- match: '\\([0tnr\"\''\\]|x\h{2}|u\h{4}|U\h{8})'
scope: constant.character.escape.swift
- match: (\\\()
captures:
1: support.punctuation.expression.begin.swift
push:
- meta_content_scope: meta.expression.swift
- match: (\))
captures:
1: support.punctuation.expression.end.swift
pop: true
- include: scope:source.swift
- match: (\"|\\)
scope: invalid.illegal.swift
- match: (.)
scope: string.quoted.double.swift
switch-statement-keyword:
- match: \b(switch|case|default|where)\b
comment: switch-statement
scope: keyword.control.switch.swift
ternary-operator:
- match: '(?<=[\s(\[{,;:])(\?|:)(?=[\s)\]},;:])'
scope: keyword.operator.ternary.swift
type:
- include: primitive-type
- include: integer-type
- include: collection-type
- include: optional-type
- include: protocol-composition-type
type-casting-operator:
- match: \b(is\b|as(\?\B|\b))
scope: keyword.operator.type-casting.swift
Vendored Submodule
+1
Submodule assets/syntaxes/Syslog added at 7628d4e0b8
Vendored Submodule
+1
Submodule assets/syntaxes/TOML added at 4e74b2b41b
Vendored Submodule
+1
Vendored Submodule
+1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Vendored Submodule
+1
Submodule assets/syntaxes/Verilog added at 532e87c1b4
+149
View File
@@ -0,0 +1,149 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Verilog
file_extensions:
- v
- V
scope: source.verilog
contexts:
main:
- match: '^\s*(module|function|primitive)\s+\b([a-zA-Z_][a-zA-Z0-9_]*)\b'
scope: meta.entity.module.verilog
captures:
1: storage.type.verilog
2: entity.name.type.class.verilog
- match: '^\s*(?!else)(?!begin)([a-zA-Z_][a-zA-Z0-9_]*)\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*(\()'
scope: meta.definition.verilog
captures:
1: entity.name.type.class.verilog
2: entity.name.type.instance.verilog
3: keyword.operator.parenthesis.round.verilog
- match: '^\s*(?!else)(?!begin)([a-zA-Z_][a-zA-Z0-9_]*)\s+([#])(\()([ ._+`,a-zA-Z0-9]+)(\))\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*(\()'
scope: meta.definition.withparameter.verilog
captures:
1: entity.name.type.class.verilog
2: keyword.other.verilog
3: keyword.operator.parenthesis.round.verilog
4: keyword.other.verilog
5: keyword.operator.parenthesis.round.verilog
6: entity.name.type.instance.verilog
7: keyword.operator.parenthesis.round.verilog
- match: '^\s*\b(?!else)(?!begin)([a-zA-Z_][a-zA-Z0-9_]*)\b\s+([#])'
scope: meta.definition.withparameter.verilog
captures:
1: entity.name.type.class.verilog
2: keyword.other.verilog
- match: '^\s*(defparam)\s+([a-zA-Z_][a-zA-Z0-9_]*)(.[a-zA-Z_][a-zA-Z0-9_]*)\s*(=)'
scope: meta.definition.defparam.verilog
captures:
1: keyword.other.verilog
2: entity.name.type.instance.verilog
3: meta.module.parameters.verilog
4: keyword.other.verilog
- match: \b(automatic|cell|config|deassign|defparam|design|disable|edge|endconfig|endgenerate|endspecify|endtable|endtask|event|generate|genvar|ifnone|incdir|include|instance|liblist|library|localparam|macromodule|negedge|noshowcancelled|posedge|pulsestyle_onevent|pulsestyle_ondetect|real|realtime|scalared|showcancelled|specify|specparam|table|task|time|use|vectored)\b
scope: keyword.other.verilog
- match: "(#[0-9]+)"
scope: keyword.delay.verilog
- match: \b(initial|always|wait|force|release|assign)\b
scope: keyword.control.verilog
- match: \b(begin|end|fork|join)\b
scope: keyword.other.verilog
- match: \b(forever|repeat|while|for|if|else|case|casex|casez|default|endcase)\b
scope: keyword.control.verilog
- match: '^\s*(`include)\s+(["<].*[">])'
scope: meta.include.verilog
captures:
1: meta.preprocessor.verilog
2: entity.name.type.include.verilog
- match: '^\s*(`ifdef|`ifndef|`undef|`define)\s+([a-zA-Z_][a-zA-Z0-9_]*)\b'
scope: meta.preprocessor.ifdef.verilog
captures:
1: meta.preprocessor.verilog
2: constant.other.define.verilog
- match: '`(celldefine|default_nettype|define|else|elsif|endcelldefine|endif|ifdef|ifndef|include|line|nounconnected_drive|resetall|timescale|unconnected_drive|undef)\b'
scope: meta.preprocessor.verilog
- match: "[.][_a-zA-Z0-9]+"
scope: meta.module.parameters.verilog
- match: '`\b([a-zA-Z_][a-zA-Z0-9_]*)\b'
scope: constant.other.define.verilog
- include: comments
- match: \b(endmodule|endfunction|endprimitive)\b
scope: storage.type.verilog
- match: '^\s*\b([a-zA-Z_][a-zA-Z0-9_]*)\b\s*(:)\s*'
scope: meta.case.verilog
captures:
1: entity.name.state.verilog
2: keyword.operator.bitwise.verilog
- include: all-types
- match: (==|===|!=|!==|<=|>=|<|>)
scope: keyword.operator.comparison.verilog
- match: (\-|\+|\*|\/|%)
scope: keyword.operator.arithmetic.verilog
- match: (!|&&|\|\|)
scope: keyword.operator.logical.verilog
- match: (&|\||\^|~|<<|>>|\?|:)
scope: keyword.operator.bitwise.verilog
- match: "({|})"
scope: keyword.operator.parenthesis.curly.verilog
- match: (\(|\))
scope: keyword.operator.parenthesis.round.verilog
- match: '(\[|\])'
scope: keyword.operator.parenthesis.square.verilog
- match: "([;,])"
scope: keyword.delimiter.verilog
- match: (#|@|=)
scope: keyword.other.verilog
- match: '\b(output|input|inout|and|nand|nor|or|xor|xnor|buf|not|bufif[01]|notif[01]|r?[npc]mos|tran|r?tranif[01]|pullup|pulldown)\b'
scope: support.type.verilog
- match: '((\b\d+)?''s?([bB]\s*(([0-1_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*))|[oO]\s*(([0-7_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*))|[dD]\s*(([0-9_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*))|[hH]\s*(([0-9a-fA-F_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*)))((e|E)(\+|-)?[0-9]+)?\b)|(\b\d+\b)'
scope: constant.numeric.verilog
- include: strings
- match: '\$\b([a-zA-Z_][a-zA-Z0-9_]*)\b'
scope: support.function.verilog
all-types:
- include: storage-type-verilog
- include: storage-modifier-verilog
comments:
- match: /\*
captures:
0: punctuation.definition.comment.verilog
push:
- meta_scope: comment.block.verilog
- match: \*/
captures:
0: punctuation.definition.comment.verilog
pop: true
- match: (//).*$\n?
scope: comment.line.double-slash.verilog
captures:
1: punctuation.definition.comment.verilog
storage-modifier-verilog:
- match: '\b(signed|unsigned|small|medium|large|supply[01]|strong[01]|pull[01]|weak[01]|highz[01])\b'
scope: storage.modifier.verilog
storage-type-verilog:
- match: '\b(wire|tri|tri[01]|supply[01]|wand|triand|wor|trior|trireg|reg|parameter|integer)\b'
scope: storage.type.verilog
strings:
- match: '"'
captures:
0: punctuation.definition.string.begin.verilog
push:
- meta_scope: string.quoted.double.verilog
- match: '"'
captures:
0: punctuation.definition.string.end.verilog
pop: true
- match: \\.
scope: constant.character.escape.verilog
- match: "'"
captures:
0: punctuation.definition.string.begin.verilog
push:
- meta_scope: string.quoted.single.verilog
- match: "'"
captures:
0: punctuation.definition.string.end.verilog
pop: true
- match: \\.
scope: constant.character.escape.verilog
Vendored Submodule
+1
Submodule assets/syntaxes/VimL added at ed40c3bc81
+91
View File
@@ -0,0 +1,91 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: VimL
file_extensions:
- vim
- .vimrc
scope: source.viml
contexts:
main:
- include: comment
- include: string_quoted_double
- include: string_quoted_single
- include: string_regex
- include: inline_comment
- include: number_int
- include: number_hex
- include: keyword
- include: support_function
- include: support_variable
- include: support_type
- include: function_params
- include: function_definition
- include: function_call
- include: function
- include: variable
- include: expr
comment:
- match: ^\s*".*$
scope: comment.line.quotes.viml
captures:
1: punctuation.definition.comment.vim
expr:
- match: (\|\||&&|==(\?|#)?|(!|>|<)=(#|\?)?|(=|!)~(#|\?)?|(>|<)(#|\?)is|isnot|\.|\*|\\|%)
scope: storage.function.viml
function:
- match: \b(fu(n|nction)?|end(f|fu|fun|function)?)\b
scope: storage.function.viml
function_call:
- match: '(([sgbwtl]|)?:?[0-9a-zA-Z_#]+)(?=\()'
scope: support.function.any-method
function_definition:
- match: '^\s*(function)\s*!?\s+(?=(s:)?[0-9a-zA-Z_#]+\s*\()'
captures:
1: storage.function.viml
push:
- meta_scope: meta.function.viml
- match: (\()
captures:
1: punctuation.definition.parameters.begin.viml
pop: true
- match: "(s:)?[0-9a-zA-Z_#]+"
scope: entity.name.function.viml
function_params:
- match: '-\w+='
scope: support.type.viml
inline_comment:
- match: '(?!\$)(")(?!\{).*$\n?'
scope: comment.line.quotes.viml
captures:
1: punctuation.definition.comment.vim
keyword:
- match: \b(if|while|for|try|return|throw|end(if|for|while|try)?|au(g|group)|else(if|)?|do|in|catch|finally|:)\b
scope: keyword.control.viml
number_hex:
- match: "0x[0-9a-f]+"
scope: constant.numeric.hex
number_int:
- match: '-?\d+'
scope: constant.numeric.integer
string_quoted_double:
- match: '"(\\\\|\\"|\n[^\S\n]*\\|[^\n"])*"'
scope: string.quoted.double.viml
string_quoted_single:
- match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
scope: string.quoted.single.viml
string_regex:
- match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
scope: string.regexp.viml
support_function:
- match: \b(set(local|global)?|let|command|filetype|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
scope: support.function.viml
support_type:
- match: <.*?>
scope: support.type.viml
support_variable:
- match: '\b(am(enu|)?|(hl|inc)?search|[Bb]uf([Nn]ew[Ff]ile|[Rr]ead)?|[Ff]ile[Tt]ype)\b'
scope: support.variable.viml
variable:
- match: '([sSgGbBwWlLaAvV]:|@|$|&(?!&))\w*'
scope: variable.other.viml
File diff suppressed because it is too large Load Diff
Vendored Submodule
+1
Submodule assets/syntaxes/hosts added at 21250a7117
+19
View File
@@ -0,0 +1,19 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: requirements.txt
file_extensions:
- requirements.txt
scope: source.requirementstxt
contexts:
main:
- match: (#).*$\n?
scope: comment.line.requirementstxt
captures:
1: punctuation.definition.comment.requirementstxt
- match: '(?i)^[a-z0-9_\-\.]+'
scope: string.package_name.requirementstxt
- match: (?i)==|<|<=|>=|>
scope: keyword.operator.logical.punctuation.requirementstxt
- match: '(?i)\d+\.[\da-z\-_\.]*'
scope: constant.numeric.verions.requirementstxt
+31
View File
@@ -0,0 +1,31 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Highlight non-printables
file_extensions:
- show-nonprintable
scope: whitespace
contexts:
main:
- match: "•"
scope: support.function.show-nonprintable.space
- match: "├─*┤"
scope: constant.character.escape.show-nonprintable.tab
- match: "↹"
scope: constant.character.escape.show-nonprintable.tab
- match: "␊"
scope: keyword.operator.show-nonprintable.line-feed
- match: "␍"
scope: string.show-nonprintable.carriage-return
- match: "␀"
scope: entity.other.attribute-name.show-nonprintable.null
- match: "␇"
scope: entity.other.attribute-name.show-nonprintable.bell
- match: "␛"
scope: entity.other.attribute-name.show-nonprintable.escape
- match: "␈"
scope: entity.other.attribute-name.show-nonprintable.backspace
- match: "\\\\x[A-Z0-9][A-Z0-9]"
scope: comment.block.show-nonprintable.backspace
- match: "\\\\u\\{[a-z0-9]+\\}"
scope: comment.block.show-nonprintable.backspace
Vendored Submodule
+1
Vendored Submodule
+1
Submodule assets/syntaxes/varlink added at 04f30d4b83
+5
View File
@@ -0,0 +1,5 @@
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Vendored Submodule
+1
Vendored Submodule
+1
Submodule assets/themes/DarkNeon added at 174bd535da
Vendored Submodule
+1
Submodule assets/themes/TwoDark added at 8e0f6fa5b5
+504
View File
@@ -0,0 +1,504 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!--
The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
palette number from 00 to 0f, and AA is the special value 00 to indicate
that this encoding is being used.
-->
<key>author</key>
<string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
<key>name</key>
<string>ANSI Dark</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#00000000</string>
<key>caret</key>
<string>#07000000</string>
<key>foreground</key>
<string>#07000000</string>
<key>invisibles</key>
<string>#07000000</string>
<key>lineHighlight</key>
<string>#07000000</string>
<key>selection</key>
<string>#07000000</string>
<key>gutter</key>
<string>#00000000</string>
<key>gutterForeground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Text</string>
<key>scope</key>
<string>variable.parameter.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>comment, punctuation.definition.comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Punctuation</string>
<key>scope</key>
<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Delimiters</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Operators</string>
<key>scope</key>
<string>keyword.operator</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keywords</string>
<key>scope</key>
<string>keyword</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variables</string>
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Functions</string>
<key>scope</key>
<string>entity.name.function, meta.require, support.function.any-method</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Labels</string>
<key>scope</key>
<string>entity.name.label</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>support.class, entity.name.class, entity.name.type.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>meta.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Methods</string>
<key>scope</key>
<string>keyword.other.special-method</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>storage</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Support</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Strings, Inherited Class</string>
<key>scope</key>
<string>string, constant.other.symbol, entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Integers</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Floats</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Boolean</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Constants</string>
<key>scope</key>
<string>constant</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tags</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attributes</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attribute IDs</string>
<key>scope</key>
<string>entity.other.attribute-name.id, punctuation.definition.entity</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Selector</string>
<key>scope</key>
<string>meta.selector</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Values</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Headings</string>
<key>scope</key>
<string>markup.heading punctuation.definition.heading, entity.name.section</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Units</string>
<key>scope</key>
<string>keyword.other.unit</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Bold</string>
<key>scope</key>
<string>markup.bold, punctuation.definition.bold</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Italic</string>
<key>scope</key>
<string>markup.italic, punctuation.definition.italic</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Code</string>
<key>scope</key>
<string>markup.raw.inline</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Text</string>
<key>scope</key>
<string>string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Url</string>
<key>scope</key>
<string>meta.link</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Quotes</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Colors</string>
<key>scope</key>
<string>constant.other.color</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Regular Expressions</string>
<key>scope</key>
<string>string.regexp</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Escape Characters</string>
<key>scope</key>
<string>constant.character.escape</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Embedded</string>
<key>scope</key>
<string>punctuation.section.embedded, variable.interpolation</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Illegal</string>
<key>scope</key>
<string>invalid.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#01000000</string>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Broken</string>
<key>scope</key>
<string>invalid.broken</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#03000000</string>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>uuid</string>
</dict>
</plist>
+504
View File
@@ -0,0 +1,504 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!--
The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
palette number from 00 to 0f, and AA is the special value 00 to indicate
that this encoding is being used.
-->
<key>author</key>
<string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
<key>name</key>
<string>ANSI Light</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#07000000</string>
<key>caret</key>
<string>#00000000</string>
<key>foreground</key>
<string>#00000000</string>
<key>invisibles</key>
<string>#00000000</string>
<key>lineHighlight</key>
<string>#00000000</string>
<key>selection</key>
<string>#00000000</string>
<key>gutter</key>
<string>#07000000</string>
<key>gutterForeground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Text</string>
<key>scope</key>
<string>variable.parameter.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>comment, punctuation.definition.comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Punctuation</string>
<key>scope</key>
<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Delimiters</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Operators</string>
<key>scope</key>
<string>keyword.operator</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keywords</string>
<key>scope</key>
<string>keyword</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variables</string>
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Functions</string>
<key>scope</key>
<string>entity.name.function, meta.require, support.function.any-method</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Labels</string>
<key>scope</key>
<string>entity.name.label</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>support.class, entity.name.class, entity.name.type.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>meta.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Methods</string>
<key>scope</key>
<string>keyword.other.special-method</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>storage</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Support</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Strings, Inherited Class</string>
<key>scope</key>
<string>string, constant.other.symbol, entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Integers</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Floats</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Boolean</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Constants</string>
<key>scope</key>
<string>constant</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tags</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attributes</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attribute IDs</string>
<key>scope</key>
<string>entity.other.attribute-name.id, punctuation.definition.entity</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Selector</string>
<key>scope</key>
<string>meta.selector</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Values</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Headings</string>
<key>scope</key>
<string>markup.heading punctuation.definition.heading, entity.name.section</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Units</string>
<key>scope</key>
<string>keyword.other.unit</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Bold</string>
<key>scope</key>
<string>markup.bold, punctuation.definition.bold</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Italic</string>
<key>scope</key>
<string>markup.italic, punctuation.definition.italic</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Code</string>
<key>scope</key>
<string>markup.raw.inline</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Text</string>
<key>scope</key>
<string>string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Url</string>
<key>scope</key>
<string>meta.link</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Quotes</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Colors</string>
<key>scope</key>
<string>constant.other.color</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Regular Expressions</string>
<key>scope</key>
<string>string.regexp</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Escape Characters</string>
<key>scope</key>
<string>constant.character.escape</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Embedded</string>
<key>scope</key>
<string>punctuation.section.embedded, variable.interpolation</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Illegal</string>
<key>scope</key>
<string>invalid.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#01000000</string>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Broken</string>
<key>scope</key>
<string>invalid.broken</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#03000000</string>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>uuid</string>
</dict>
</plist>
+543
View File
@@ -0,0 +1,543 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!--
The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
palette number from 00 to 0f, and AA is the special value 00 to indicate
that this encoding is being used.
-->
<key>author</key>
<string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
<key>name</key>
<string>Base16</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#00000000</string>
<key>caret</key>
<string>#07000000</string>
<key>foreground</key>
<string>#07000000</string>
<key>invisibles</key>
<string>#08000000</string>
<key>lineHighlight</key>
<string>#08000000</string>
<key>selection</key>
<string>#0b000000</string>
<key>gutter</key>
<string>#0a000000</string>
<key>gutterForeground</key>
<string>#08000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Text</string>
<key>scope</key>
<string>variable.parameter.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>comment, punctuation.definition.comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#08000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Punctuation</string>
<key>scope</key>
<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Delimiters</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Operators</string>
<key>scope</key>
<string>keyword.operator</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keywords</string>
<key>scope</key>
<string>keyword</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variables</string>
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Functions</string>
<key>scope</key>
<string>entity.name.function, meta.require, support.function.any-method</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Labels</string>
<key>scope</key>
<string>entity.name.label</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0e000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>support.class, entity.name.class, entity.name.type.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>meta.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Methods</string>
<key>scope</key>
<string>keyword.other.special-method</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>storage</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Support</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Strings, Inherited Class</string>
<key>scope</key>
<string>string, constant.other.symbol, entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Integers</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Floats</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Boolean</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Constants</string>
<key>scope</key>
<string>constant</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tags</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attributes</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Attribute IDs</string>
<key>scope</key>
<string>entity.other.attribute-name.id, punctuation.definition.entity</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Selector</string>
<key>scope</key>
<string>meta.selector</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Values</string>
<key>scope</key>
<string>none</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Headings</string>
<key>scope</key>
<string>markup.heading punctuation.definition.heading, entity.name.section</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Units</string>
<key>scope</key>
<string>keyword.other.unit</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Bold</string>
<key>scope</key>
<string>markup.bold, punctuation.definition.bold</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Italic</string>
<key>scope</key>
<string>markup.italic, punctuation.definition.italic</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Code</string>
<key>scope</key>
<string>markup.raw.inline</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Text</string>
<key>scope</key>
<string>string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Link Url</string>
<key>scope</key>
<string>meta.link</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Quotes</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Separator</string>
<key>scope</key>
<string>meta.separator</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#0b000000</string>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Colors</string>
<key>scope</key>
<string>constant.other.color</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Regular Expressions</string>
<key>scope</key>
<string>string.regexp</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Escape Characters</string>
<key>scope</key>
<string>constant.character.escape</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Embedded</string>
<key>scope</key>
<string>punctuation.section.embedded, variable.interpolation</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Illegal</string>
<key>scope</key>
<string>invalid.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#01000000</string>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Broken</string>
<key>scope</key>
<string>invalid.broken</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#09000000</string>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Deprecated</string>
<key>scope</key>
<string>invalid.deprecated</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#0e000000</string>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Unimplemented</string>
<key>scope</key>
<string>invalid.unimplemented</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#08000000</string>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>uuid</string>
</dict>
</plist>
Vendored Submodule
+1
Submodule assets/themes/onehalf added at 2516b37c3f
Vendored Submodule
+1
Submodule assets/themes/zenburn added at b7f27e2f65
+31
View File
@@ -0,0 +1,31 @@
// TODO: Re-enable generation of shell completion files (below) when clap 3 is out.
// For more details, see https://github.com/sharkdp/bat/issues/372
fn main() {}
// #[macro_use]
// extern crate clap;
// use clap::Shell;
// use std::fs;
// include!("src/clap_app.rs");
// const BIN_NAME: &str = "bat";
// fn main() {
// let outdir = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));
// let outdir = match outdir {
// None => return,
// Some(outdir) => outdir,
// };
// fs::create_dir_all(&outdir).unwrap();
// let mut app = build_app(true);
// app.gen_completions(BIN_NAME, Shell::Bash, &outdir);
// app.gen_completions(BIN_NAME, Shell::Fish, &outdir);
// app.gen_completions(BIN_NAME, Shell::Zsh, &outdir);
// app.gen_completions(BIN_NAME, Shell::PowerShell, &outdir);
// }
+1
View File
@@ -0,0 +1 @@
* linguist-vendored

Some files were not shown because too many files have changed in this diff Show More