mirror of
https://github.com/sharkdp/bat
synced 2026-08-03 18:51:44 +00:00
Compare commits
518 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 79f016e15c | |||
| 26f9125ebb | |||
| 9814eab13f | |||
| 82ca8804a2 | |||
| b48b9fcf3b | |||
| c64ab29739 | |||
| 83dd3fb551 | |||
| ed345f2889 | |||
| d2492980c0 | |||
| 47d5130764 | |||
| 4ba45e2ba2 | |||
| 7076ae5cd9 | |||
| 2e71146801 | |||
| f3824bad17 | |||
| ec908d5937 | |||
| 3a75d85b80 | |||
| 63d652dab5 | |||
| 7f2e61d579 | |||
| e289a2c698 | |||
| 83a213bae7 | |||
| 3967e28ded | |||
| 2dc2a3712a | |||
| 10e0f9efb0 | |||
| f8ea075e78 | |||
| c187dce2c2 | |||
| 108c907d69 | |||
| 187a3b9341 | |||
| 9c2d4f6a51 | |||
| c1126157d4 | |||
| dcfa810112 | |||
| f963104006 | |||
| 45e1c0ea6f | |||
| 590a1e9a4b | |||
| 8e2c6abb13 | |||
| 28266ee441 | |||
| 21821f1d4c | |||
| 772ce2e4fe | |||
| 35ca1c5191 | |||
| 0cc60a1519 | |||
| ee6659dacf | |||
| 76c615a304 | |||
| e8c04672f0 | |||
| 7f5a5612e4 | |||
| eee5d424bb | |||
| e5311e4b30 | |||
| a1b9334a44 | |||
| d86b7cf7e0 | |||
| 67834da681 | |||
| dcdf8dfaa7 | |||
| 9a44fa11c0 | |||
| 4ee0b2e16d | |||
| 518997135e | |||
| 69fc1caead | |||
| 175dd4c290 | |||
| e9210c0f6c | |||
| 3795acbd17 | |||
| c7d08cfcfd | |||
| 8ec96da9f0 | |||
| c9d7e3652b | |||
| dfa024f9e6 | |||
| b2757cb461 | |||
| 416a0fd439 | |||
| 9b1b3dda14 | |||
| ae7db313a6 | |||
| 3c4384990d | |||
| 260814c377 | |||
| 3675a82a1b | |||
| 5b2b594919 | |||
| 9d53ce6be6 | |||
| 51e05499a9 | |||
| dd40f7545d | |||
| c709bf2103 | |||
| f37dbb80a8 | |||
| 0a1e08da96 | |||
| 06b8dcb7eb | |||
| 493a4e719e | |||
| 27e0ca98d9 | |||
| 1b2066c5f2 | |||
| 4ec3cdb5b8 | |||
| 72152296c7 | |||
| 2b9d25df05 | |||
| cc8186103b | |||
| 0ad09df7ab | |||
| 7ef0fe091d | |||
| 89fcbb2b15 | |||
| a7e2bb86cb | |||
| 1ce0bc8e0d | |||
| fde00eec98 | |||
| bb6594e691 | |||
| e7c5561df7 | |||
| 0aabbc03d7 | |||
| 8a5b59febc | |||
| 7afdd44c43 | |||
| d72549a873 | |||
| 1ba8540e5f | |||
| a6cee4da67 | |||
| cd6850947e | |||
| 14bfedeb20 | |||
| 8fe65252f7 | |||
| 5e9351445f | |||
| 2fdfb8de40 | |||
| f8c759edff | |||
| e34431f922 | |||
| c96927b550 | |||
| 921cc0d1cb | |||
| dbc49e534a | |||
| 7755ed79e0 | |||
| 50aabf331d | |||
| f259ff2920 | |||
| 82f14121bd | |||
| a21ae614e6 | |||
| b94c94e845 | |||
| 161d107ec3 | |||
| ecf147fd96 | |||
| f0771d6532 | |||
| d8f28c177a | |||
| fbee9df719 | |||
| 6e9ca7d6dc | |||
| a9ec5c063a | |||
| 8470fd7173 | |||
| 76b7418e35 | |||
| 10c5f79640 | |||
| 9e11d66979 | |||
| fa3244f7c1 | |||
| 906774e6d3 | |||
| cec9cc073c | |||
| a16789a060 | |||
| e09499b3df | |||
| cff01d81fa | |||
| 31608c9a03 | |||
| 357ce84c56 | |||
| 3a5c52641b | |||
| 6e8fca5bb2 | |||
| 63c77383ce | |||
| 4df22e617f | |||
| 6473e8c1be | |||
| 972a764a74 | |||
| 54143d1403 | |||
| 6523bbf62f | |||
| 05e2c2c66b | |||
| 69227222b5 | |||
| 49af3e854b | |||
| 6a8e4757b7 | |||
| 91deef8b13 | |||
| 61e888de7f | |||
| f3f9f10f05 | |||
| 29ffa2a832 | |||
| 42a873fdb8 | |||
| 82f048aedb | |||
| ae08785ec8 | |||
| a500629359 | |||
| 724a5fac99 | |||
| c483e49b92 | |||
| 94c9b40694 | |||
| 0c9dc3b257 | |||
| 3b5174bb1d | |||
| 3324505383 | |||
| de7872f8a8 | |||
| abf0229741 | |||
| e04bccd12d | |||
| 668c8a6703 | |||
| bd68684537 | |||
| c2847f6a9f | |||
| cf7ed042c1 | |||
| 6b92814ea0 | |||
| a236a9b195 | |||
| b68c5d8576 | |||
| fee57d71d9 | |||
| 5d3205acc0 | |||
| 4e6816abd6 | |||
| 72e8036edc | |||
| 397def1320 | |||
| d2d29180a7 | |||
| 2f263c9fbf | |||
| 4ff360669f | |||
| 549e5d7355 | |||
| dd48d29c28 | |||
| 98ee5f7400 | |||
| 638c04c13e | |||
| b1c865acaa | |||
| d3d795ffb2 | |||
| 0571c51487 | |||
| 348c9f3562 | |||
| 6b6a8f8e16 | |||
| 6aa002850c | |||
| 49c22c8d39 | |||
| 673caf6b59 | |||
| e6ffab3cb4 | |||
| 4e43f8fa74 | |||
| bac1b16885 | |||
| 778a4929a8 | |||
| 5c22dd4248 | |||
| 214cd0f8ea | |||
| 9fd61fcb6d | |||
| edf1d3b256 | |||
| eca47b2a28 | |||
| 62424e70d7 | |||
| 4791f15222 | |||
| 159f234b78 | |||
| 3ec96127f2 | |||
| a9acb2711b | |||
| a3182e68e4 | |||
| 0691b18231 | |||
| c711cd1b2e | |||
| 14e6b41a5f | |||
| 532af6556d | |||
| 26717b0cd2 | |||
| 1f177f0a1c | |||
| 54c81fa543 | |||
| 34dee9e3aa | |||
| c073d4a118 | |||
| e79c5516bf | |||
| 4776c2a575 | |||
| f98a96c1ed | |||
| 8a3446d219 | |||
| 5d5bf616ca | |||
| b68c038db8 | |||
| 1117d2f9cb | |||
| d0ba5bcb32 | |||
| f8d39d5624 | |||
| 9998e2eac6 | |||
| 7cac07d845 | |||
| 148caa1381 | |||
| ab27cac0cc | |||
| 01fcbf2183 | |||
| 8a0c30b385 | |||
| bc21c4d0e0 | |||
| 0800562ba2 | |||
| 1f9befbcd1 | |||
| a5c779c518 | |||
| f37f100352 | |||
| 18d1a3b973 | |||
| dc10246bd2 | |||
| 44bdae0212 | |||
| 1ece38a4c4 | |||
| e90308e1f8 | |||
| d702d6740c | |||
| c6a526f99c | |||
| 278d841408 | |||
| 5f576f1ecf | |||
| 48c6ea6b25 | |||
| 558134f6c8 | |||
| 1dd57e6d7e | |||
| 20ba84d1fa | |||
| e81f9b23e6 | |||
| 50dc4a79b0 | |||
| 8fa8f44706 | |||
| ecd862d9ff | |||
| cbed338c3a | |||
| 4492d99556 | |||
| d96ee2261f | |||
| dda27b253b | |||
| 78f26d0caf | |||
| abcd09f869 | |||
| 41a5ff039b | |||
| 155bad3862 | |||
| 7c98a1c901 | |||
| c1246fcd53 | |||
| 9f401ea122 | |||
| 9c782fb692 | |||
| 154186a58d | |||
| b22a9f8fe3 | |||
| 5219c40ed8 | |||
| a25ee0e6fd | |||
| 496e0bc046 | |||
| 7082fd09f0 | |||
| 857cc215b4 | |||
| 481268f018 | |||
| f7d9f49503 | |||
| 88fcfd76aa | |||
| 76e34b29ec | |||
| 01984e1d02 | |||
| 536390509f | |||
| 58198d0700 | |||
| afc5aacb28 | |||
| 30b742e984 | |||
| 671deeef8c | |||
| a892caeb33 | |||
| a770cbf25e | |||
| 931c6e9414 | |||
| 8dc7e2efa3 | |||
| 10965a6122 | |||
| e43d97dc15 | |||
| 2c7087b8de | |||
| bb1f5aa841 | |||
| 2109a7830b | |||
| ec27c78a8a | |||
| 67fe833bc8 | |||
| e956225b4d | |||
| 314ec881ef | |||
| 25a6a55437 | |||
| 5bff4548be | |||
| 866b9e16a8 | |||
| 5af176c94f | |||
| 9e7da05459 | |||
| 1ae02c65fb | |||
| 495e7fd3b1 | |||
| b48f0fe389 | |||
| c19c704a43 | |||
| 693bd5929d | |||
| 8275b0436d | |||
| 278bde5cee | |||
| eee7e5a575 | |||
| ad7b634ee6 | |||
| 1310f83c8d | |||
| 897b9e7030 | |||
| 1891e194b5 | |||
| cea05e9f22 | |||
| d2d01b9fe8 | |||
| 2a7851530d | |||
| 1a6709c2cb | |||
| 5842d58c01 | |||
| e3c71adba7 | |||
| 504f28b3a1 | |||
| d977ba9194 | |||
| 9c09799e1f | |||
| d83c93c805 | |||
| fc8fd1e63f | |||
| 404d6a4a81 | |||
| 25d96da4a2 | |||
| e97095b724 | |||
| ce96df00b6 | |||
| f98fc5f06a | |||
| 1dbb4ef683 | |||
| 0502a3bd4a | |||
| 869cf6368c | |||
| 078228deac | |||
| e09d7dabb8 | |||
| 6d1cc8c2c8 | |||
| 87f021078e | |||
| d5b0502419 | |||
| 860f3e9006 | |||
| 1be346a038 | |||
| f9fd5e4851 | |||
| da09f3877b | |||
| e30e1bab2e | |||
| f140f6da46 | |||
| 3446fdf5f2 | |||
| e1345cdc2a | |||
| a2676ccc55 | |||
| b39e28d2c8 | |||
| 0d71968615 | |||
| 80da0dc619 | |||
| 64903bb858 | |||
| 3456ce1187 | |||
| 886a5b3d24 | |||
| 238482e5f3 | |||
| 79b960e17e | |||
| 6aa626f1c4 | |||
| 1b30539493 | |||
| 96b24d8a7e | |||
| 20b02e72b3 | |||
| 254efac9c2 | |||
| dcec322117 | |||
| d781156327 | |||
| 732750c274 | |||
| 6b6baa3118 | |||
| 54c434934e | |||
| ad6e0a2581 | |||
| bd619db3ca | |||
| e098eb43a2 | |||
| ea369ee17f | |||
| 63d32bc818 | |||
| dccf8d8221 | |||
| 97129ab9d8 | |||
| 52d0d6ca30 | |||
| a05494e9d9 | |||
| 84ac92efbb | |||
| b4c6e412dc | |||
| 3e21d69a92 | |||
| b7690d4bb1 | |||
| d404139ff7 | |||
| 9ef1e9f792 | |||
| 503fe0b641 | |||
| 1807f9653c | |||
| 1e74f0e2a9 | |||
| c1e1f753cf | |||
| d90797f8e9 | |||
| b4096e5627 | |||
| 4e3ab4d399 | |||
| f0d936763c | |||
| 7897260bf0 | |||
| eb6e43b9a9 | |||
| 7cdcdbb31d | |||
| 9159341714 | |||
| b23ff24ebc | |||
| e1ecc17f69 | |||
| 0fe3badf19 | |||
| 89d4cb951a | |||
| e9681bf22d | |||
| 1b6df8a480 | |||
| cf24986edb | |||
| b9c556a0b6 | |||
| 9d6bde48fa | |||
| d6c8fee044 | |||
| 8b4abb03db | |||
| 375cf76e15 | |||
| 1a4acc435e | |||
| d8030626f8 | |||
| fb61aa4f60 | |||
| 76df41fa97 | |||
| 97efd75cee | |||
| 53d0c1deca | |||
| 155179a07a | |||
| ba00caf9c3 | |||
| ac418ba21c | |||
| acde83af31 | |||
| 021a68eb21 | |||
| 566aab3b05 | |||
| f88eba6476 | |||
| 1d9e7ac4c2 | |||
| 80ae2ecbf8 | |||
| 96d4492d27 | |||
| c90f0b8e21 | |||
| 4b866ab6af | |||
| 2dbd91e543 | |||
| 785da3d9df | |||
| d455cb7c32 | |||
| d2b4766f92 | |||
| 5cf92b4f94 | |||
| 7b803a50af | |||
| 67ec5fe2b7 | |||
| 3447ed4def | |||
| 532fb921a6 | |||
| ba4d5a2e7d | |||
| 026273a05c | |||
| 8903b64830 | |||
| 194155f062 | |||
| a6ff3b900d | |||
| 8a52bcf92d | |||
| 0b1535f63b | |||
| 0a5b3eaf3e | |||
| 11294249f8 | |||
| 35a1236ad0 | |||
| af8da50c2c | |||
| 649d1e3df2 | |||
| 199cfd4519 | |||
| c7cce0752b | |||
| 3a89486189 | |||
| 720a2fb7a5 | |||
| e3c990f11e | |||
| 90c7d0c365 | |||
| 56002267d2 | |||
| 84734eac9d | |||
| acdea97e71 | |||
| 839e4ee611 | |||
| c7afcdebf8 | |||
| 08e6db1581 | |||
| 4d08ecd828 | |||
| 28e1d0e613 | |||
| d11839ad03 | |||
| 8cacd9b432 | |||
| 6f67444c99 | |||
| fd2b376ea0 | |||
| cda54e4f61 | |||
| 3b90ada735 | |||
| 1837d364fe | |||
| 4ea3e6bbb7 | |||
| 38544ed735 | |||
| 5444b0dfed | |||
| f3dde0185d | |||
| 2e3784aa30 | |||
| 1088455702 | |||
| 4f812c32ab | |||
| b6c59a5bd4 | |||
| b682679776 | |||
| 81771432fb | |||
| 627181bcb6 | |||
| 226d9a573a | |||
| 246cf79dbd | |||
| ea955c734d | |||
| 6223ad6d52 | |||
| 31a9335bd5 | |||
| 9316f2a758 | |||
| c884c3cc12 | |||
| 08850f0474 | |||
| 8e6c5bc562 | |||
| 052425b12f | |||
| 2df3305b94 | |||
| 6882fc1512 | |||
| 2508323264 | |||
| 297afad337 | |||
| 1dddce3aa1 | |||
| 76be0d3933 | |||
| e5b8c4471a | |||
| b191691767 | |||
| 5c95b8803b | |||
| 5b421b455d | |||
| a6d6c28723 | |||
| 2966939e38 | |||
| d179693d1d | |||
| 268577c6f9 | |||
| 037861e588 | |||
| 94ccc646e8 | |||
| 0cc5d1dab6 | |||
| 28397b8f78 | |||
| c899849101 | |||
| bf53b64125 | |||
| c68aa0f424 | |||
| 6b57f4eebc | |||
| 0ddd388a29 | |||
| 34811b8161 | |||
| 8b92aae23f | |||
| 3a0941cabe | |||
| 52877c6d67 | |||
| 455de98a89 | |||
| 8c6a74a6c5 | |||
| 3f8b340ed8 | |||
| 65e6970907 | |||
| 90cc019482 | |||
| eaf0b99d25 | |||
| 3b1dcca5d0 | |||
| 26dbdf4fa0 | |||
| 6691786d82 | |||
| 50209bfe21 | |||
| c91511cca1 | |||
| c9f7a0c126 | |||
| 69c798eafd |
+115
-2
@@ -6,7 +6,7 @@
|
||||
url = https://github.com/sublimehq/Packages/
|
||||
[submodule "assets/syntaxes/TOML"]
|
||||
path = assets/syntaxes/TOML
|
||||
url = https://github.com/sharkdp/sublime_toml_highlighting
|
||||
url = https://github.com/jasonwilliams/sublime_toml_highlighting
|
||||
[submodule "assets/syntaxes/Julia"]
|
||||
path = assets/syntaxes/Julia
|
||||
url = https://github.com/JuliaEditorSupport/Julia-sublime
|
||||
@@ -24,7 +24,7 @@
|
||||
url = https://github.com/clintberry/sublime-text-2-ini
|
||||
[submodule "assets/syntaxes/CMake"]
|
||||
path = assets/syntaxes/CMake
|
||||
url = https://github.com/sharkdp/Sublime-CMakeLists
|
||||
url = https://github.com/zyxar/Sublime-CMakeLists
|
||||
[submodule "assets/syntaxes/LESS"]
|
||||
path = assets/syntaxes/LESS
|
||||
url = https://github.com/danro/LESS-sublime
|
||||
@@ -40,3 +40,116 @@
|
||||
[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
|
||||
|
||||
+28
-18
@@ -1,5 +1,5 @@
|
||||
language: rust
|
||||
cache: cargo
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# Stable channel.
|
||||
@@ -17,18 +17,30 @@ matrix:
|
||||
- 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
|
||||
|
||||
# Code formatting check
|
||||
@@ -39,15 +51,10 @@ matrix:
|
||||
- cargo install --debug --force rustfmt-nightly
|
||||
script: cargo fmt -- --check
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
# needed for i686-unknown-linux-gnu target
|
||||
- gcc-multilib
|
||||
# needed for musl targets
|
||||
- musl-tools
|
||||
# needed to build deb packages
|
||||
- fakeroot
|
||||
sudo: required
|
||||
|
||||
before_install:
|
||||
- ci/before_install.bash
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -62,11 +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 README.md --paging=never
|
||||
- ci/script.bash
|
||||
|
||||
before_deploy:
|
||||
- bash ci/before_deploy.bash
|
||||
@@ -100,3 +103,10 @@ deploy:
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
|
||||
# Caching
|
||||
cache:
|
||||
directories:
|
||||
- /home/travis/.cargo
|
||||
before_cache:
|
||||
- rm -rf /home/travis/.cargo/registry
|
||||
|
||||
Generated
+897
-475
File diff suppressed because it is too large
Load Diff
+25
-10
@@ -7,35 +7,50 @@ license = "MIT/Apache-2.0"
|
||||
name = "bat"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/sharkdp/bat"
|
||||
version = "0.4.1"
|
||||
version = "0.12.0"
|
||||
exclude = [
|
||||
"assets/syntaxes/*",
|
||||
"assets/themes/*",
|
||||
]
|
||||
build = "build.rs"
|
||||
edition = '2018'
|
||||
|
||||
[dependencies]
|
||||
atty = "0.2.2"
|
||||
ansi_term = "0.10"
|
||||
console = "0.6"
|
||||
directories = "0.10"
|
||||
lazy_static = "1.0"
|
||||
atty = "0.2.13"
|
||||
ansi_term = "0.12"
|
||||
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.7"
|
||||
version = "0.10"
|
||||
default-features = false
|
||||
features = []
|
||||
|
||||
[dependencies.syntect]
|
||||
version = "2.1"
|
||||
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.11"
|
||||
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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<p align="center">
|
||||
<img src="doc/logo-header.svg" alt="bat - a cat clone with wings"><br>
|
||||
<a href="Version info"><img src="https://travis-ci.org/sharkdp/bat.svg?branch=master" alt="Build Status"></a>
|
||||
<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.
|
||||
@@ -11,7 +12,8 @@
|
||||
<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>
|
||||
<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
|
||||
@@ -28,6 +30,13 @@ languages:
|
||||
|
||||

|
||||
|
||||
### Show non-printable characters
|
||||
|
||||
You can use the `-A`/`--show-all` option to show and highlight non-printable
|
||||
characters:
|
||||
|
||||

|
||||
|
||||
### Automatic paging
|
||||
|
||||
`bat` can pipe its own output to `less` if the output is too large for one screen.
|
||||
@@ -35,8 +44,9 @@ languages:
|
||||
### File concatenation
|
||||
|
||||
Oh.. you can also use it to concatenate files :wink:. Whenever
|
||||
`bat` detects a non-interactive terminal, it will fall back to printing
|
||||
the plain file contents.
|
||||
`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
|
||||
|
||||
@@ -52,17 +62,24 @@ Display multiple files at once
|
||||
> bat src/*.rs
|
||||
```
|
||||
|
||||
Read from stdin, explicitly specify the language
|
||||
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
|
||||
> curl -s https://raw.githubusercontent.com/sharkdp/bat/master/src/main.rs | bat -l rs
|
||||
> bat -A /etc/hosts
|
||||
```
|
||||
|
||||
As a replacement for `cat`:
|
||||
Use it as a `cat` replacement:
|
||||
|
||||
```bash
|
||||
bat > note.md # quickly create a new file
|
||||
@@ -71,28 +88,115 @@ bat header.md content.md footer.md > document.md
|
||||
|
||||
bat -n main.rs # show line numbers (only)
|
||||
|
||||
cat f - g # output 'f', then stdin, then 'g'.
|
||||
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
|
||||
|
||||
### From binaries
|
||||
### On Ubuntu
|
||||
*... and other Debian-based Linux distributions.*
|
||||
|
||||
Check out the [Release page](https://github.com/sharkdp/bat/releases) for
|
||||
binary builds and Debian packages.
|
||||
|
||||
#### 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
|
||||
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.0_amd64.deb # adapt version number and architecture
|
||||
```
|
||||
|
||||
#### On FreeBSD
|
||||
### 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:
|
||||
|
||||
@@ -107,7 +211,23 @@ cd /usr/ports/textproc/bat
|
||||
make install
|
||||
```
|
||||
|
||||
#### On macOS
|
||||
### 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):
|
||||
|
||||
@@ -115,77 +235,130 @@ You can install `bat` with [Homebrew](http://braumeister.org/formula/bat):
|
||||
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
|
||||
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
|
||||
If you want to build `bat` from source, you need Rust 1.35 or
|
||||
higher. You can then use `cargo` to build everything:
|
||||
|
||||
```bash
|
||||
cargo install bat
|
||||
```
|
||||
|
||||
On macOS, you might have to install `cmake` (`brew install cmake`) in order for
|
||||
some dependencies to be built.
|
||||
You may have to install `cmake` and the `libz` development package
|
||||
(`libz-dev` or `libz-devel`) in order for the build to succeed.
|
||||
|
||||
## Customization
|
||||
|
||||
### Highlighting theme
|
||||
|
||||
Use `bat --list-themes` to get a list of all available themes for syntax
|
||||
highlighting. To select the `TwoDark` theme, for example, call `bat` with
|
||||
the `--theme=TwoDark` option. Use `alias bat="bat --theme=TwoDark"` in your
|
||||
shells startup file to make the change permanent.
|
||||
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
|
||||
bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
|
||||
```
|
||||
|
||||
`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).
|
||||
|
||||
### Output style
|
||||
|
||||
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.
|
||||
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).
|
||||
|
||||
### Add new syntaxes and highlighting themes
|
||||
### 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.
|
||||
and theme. To add new syntax definitions, do the following.
|
||||
|
||||
To build your own language-set and theme, follow these steps:
|
||||
|
||||
Create a folder with a syntax highlighting theme:
|
||||
Create a folder with syntax definition files:
|
||||
|
||||
```bash
|
||||
BAT_CONFIG_DIR="$(bat cache --config-dir)"
|
||||
mkdir -p "$(bat --config-dir)/syntaxes"
|
||||
cd "$(bat --config-dir)/syntaxes"
|
||||
|
||||
mkdir -p "$BAT_CONFIG_DIR/themes"
|
||||
cd "$BAT_CONFIG_DIR/themes"
|
||||
|
||||
# Download a theme, for example:
|
||||
git clone https://github.com/greggb/sublime-snazzy
|
||||
|
||||
# Create a link for the default theme
|
||||
ln -sf "sublime-snazzy/Sublime Snazzy.tmTheme" Default.tmTheme
|
||||
# Put new '.sublime-syntax' language definition files
|
||||
# in this folder (or its subdirectories), for example:
|
||||
git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
||||
```
|
||||
|
||||
Create a folder with language definition files:
|
||||
Now use the following command to parse these files into a binary cache:
|
||||
|
||||
```bash
|
||||
mkdir -p "$BAT_CONFIG_DIR/syntaxes"
|
||||
cd "$BAT_CONFIG_DIR/syntaxes"
|
||||
|
||||
# Download some language definition files, for example:
|
||||
git clone https://github.com/sublimehq/Packages
|
||||
git clone https://github.com/danro/LESS-sublime
|
||||
bat cache --build
|
||||
```
|
||||
|
||||
Finally, use the following command to parse all these files into a binary
|
||||
cache:
|
||||
|
||||
```bash
|
||||
bat cache --init
|
||||
```
|
||||
|
||||
Use `bat --list-languages` and `bat --list-themes` to check if all languages and themes are
|
||||
available.
|
||||
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:
|
||||
|
||||
@@ -193,6 +366,176 @@ If you ever want to go back to the default settings, call:
|
||||
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
|
||||
don’t 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:
|
||||
|
||||
@@ -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
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
* linguist-vendored
|
||||
Vendored
+13
@@ -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
|
||||
|
||||
Vendored
+11
-2
@@ -13,12 +13,15 @@ In order to add new syntaxes to `bat`, follow these steps:
|
||||
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 --init` to parse all available
|
||||
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
|
||||
@@ -28,4 +31,10 @@ themes (`bat cache --clear`).
|
||||
|
||||
The following files have been manually modified after converting from a `.tmLanguage` file:
|
||||
|
||||
* `VimL.sublime-syntax` => added `.vimrc` file type.
|
||||
* `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
|
||||
|
||||
Vendored
+76
@@ -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"
|
||||
+13
-1
@@ -1,5 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
bat cache --init --source="$ASSET_DIR" --target="$ASSET_DIR"
|
||||
# Always remove the local cache to avoid any confusion
|
||||
bat cache --clear
|
||||
|
||||
# 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 cache --build --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
|
||||
|
||||
patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
Submodule assets/syntaxes/AWK added at 1ce5f90d44
+1
Submodule assets/syntaxes/AsciiDoc added at d0089991e5
+283
@@ -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
|
||||
+1
Submodule assets/syntaxes/Assembly (ARM) added at 08f33d80de
+172
@@ -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
|
||||
+1367
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
Submodule assets/syntaxes/CMake updated: a71f52a390...aba96a0862
+1
Submodule assets/syntaxes/CSV added at 4786d037a7
Vendored
+46
@@ -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
|
||||
+1
Submodule assets/syntaxes/Cabal added at 1c054d9b36
Vendored
+47
@@ -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
|
||||
+1
Submodule assets/syntaxes/Crystal added at 2f96cec2ca
+1036
File diff suppressed because it is too large
Load Diff
+1
Submodule assets/syntaxes/Dart added at d891fb36c9
Vendored
+369
@@ -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
|
||||
+1
Submodule assets/syntaxes/DotENV added at f6cad1140c
+88
@@ -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
|
||||
+1
Submodule assets/syntaxes/Elm added at dfbb8bdc9a
+1
Submodule assets/syntaxes/FSharp added at c18616d6bd
+672
@@ -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
|
||||
+1
Submodule assets/syntaxes/GraphQL added at 66ce8713d8
+662
@@ -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
|
||||
Vendored
+23
@@ -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
+3
@@ -12,9 +12,12 @@ file_extensions:
|
||||
- lng
|
||||
- cfg
|
||||
- CFG
|
||||
- desktop
|
||||
- url
|
||||
- URL
|
||||
- .editorconfig
|
||||
- .hgrc
|
||||
- hgrc
|
||||
scope: source.ini
|
||||
contexts:
|
||||
main:
|
||||
|
||||
+1
Submodule assets/syntaxes/JavaScript (Babel) added at a9a908fe1d
+1288
File diff suppressed because it is too large
Load Diff
+1
Submodule assets/syntaxes/Jsonnet added at 80775c616e
+1
Submodule assets/syntaxes/Kotlin added at aeeed2780b
+398
@@ -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
+1
-1
Submodule assets/syntaxes/LESS updated: 46694c86b9...d3ddfe7b51
+44
@@ -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
|
||||
+1
Submodule assets/syntaxes/Nix added at ebf06571f3
Vendored
+609
@@ -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
|
||||
+1
Submodule assets/syntaxes/Org mode added at 4976d8f84e
+219
@@ -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
+1
-1
Submodule assets/syntaxes/Packages updated: 1cb4c3ec36...c1a7427015
+1
Submodule assets/syntaxes/PowerShell added at 12b7d7257e
+466
@@ -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
|
||||
+1
Submodule assets/syntaxes/Protobuf added at 5115c1c59a
+1
Submodule assets/syntaxes/Puppet added at 2a224343d2
+1
Submodule assets/syntaxes/PureScript added at 42a61e39ad
+1
Submodule assets/syntaxes/Robot added at 8e5a349a3e
Vendored
+54
@@ -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
|
||||
+1
Submodule assets/syntaxes/SCSS_Sass added at 1195db9f16
+1
Submodule assets/syntaxes/Strace added at 3ec51e0bca
+1
Submodule assets/syntaxes/Swift added at fef17119ce
Vendored
+371
@@ -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
|
||||
+1
Submodule assets/syntaxes/Syslog added at 7628d4e0b8
Vendored
+1
-1
Submodule assets/syntaxes/TOML updated: b5e3064e99...4e74b2b41b
+1
Submodule assets/syntaxes/Terraform added at 3227a2d2a2
+1
Submodule assets/syntaxes/TypeScript added at 19a599ad0e
+3027
File diff suppressed because it is too large
Load Diff
+3161
File diff suppressed because it is too large
Load Diff
+1
Submodule assets/syntaxes/Verilog added at 532e87c1b4
+149
@@ -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
+1
-1
Submodule assets/syntaxes/VimL updated: b453aff6f7...ed40c3bc81
Vendored
+1
-1
@@ -63,7 +63,7 @@ contexts:
|
||||
- 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: "#[0-9a-f]{6}"
|
||||
- match: "0x[0-9a-f]+"
|
||||
scope: constant.numeric.hex
|
||||
number_int:
|
||||
- match: '-?\d+'
|
||||
|
||||
Vendored
+1009
File diff suppressed because it is too large
Load Diff
+1
Submodule assets/syntaxes/hosts added at 21250a7117
+1
Submodule assets/syntaxes/requirementstxt added at 775e6dd62a
+19
@@ -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
|
||||
@@ -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
|
||||
+1
Submodule assets/syntaxes/ssh-config added at 86bfd1b090
+1
Submodule assets/syntaxes/sublime-fish added at 079576415a
+1
Submodule assets/syntaxes/varlink added at 04f30d4b83
Vendored
+5
@@ -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);
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
Vendored
+1
-1
Submodule assets/themes/1337-Scheme updated: 82db0222c3...ca6a329cfd
Vendored
-1
@@ -1 +0,0 @@
|
||||
sublime-monokai-extended/Monokai Extended.tmTheme
|
||||
Vendored
+504
@@ -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>
|
||||
Vendored
+504
@@ -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>
|
||||
Vendored
+543
@@ -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>
|
||||
+1
Submodule assets/themes/onehalf added at 2516b37c3f
+1
Submodule assets/themes/sublime-snazzy added at 70343201f1
+1
Submodule assets/themes/zenburn added at b7f27e2f65
@@ -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);
|
||||
// }
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
* linguist-vendored
|
||||
Vendored
+85
-5
@@ -11,23 +11,41 @@ pack() {
|
||||
local tempdir
|
||||
local out_dir
|
||||
local package_name
|
||||
local gcc_prefix
|
||||
|
||||
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
|
||||
out_dir=$(pwd)
|
||||
package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
|
||||
|
||||
if [[ $TARGET == "arm-unknown-linux-gnueabihf" ]]; then
|
||||
gcc_prefix="arm-linux-gnueabihf-"
|
||||
elif [[ $TARGET == "aarch64-unknown-linux-gnu" ]]; then
|
||||
gcc_prefix="aarch64-linux-gnu-"
|
||||
else
|
||||
gcc_prefix=""
|
||||
fi
|
||||
|
||||
# create a "staging" directory
|
||||
mkdir "$tempdir/$package_name"
|
||||
mkdir "$tempdir/$package_name/autocomplete"
|
||||
|
||||
# copying the main binary
|
||||
cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
|
||||
strip "$tempdir/$package_name/$PROJECT_NAME"
|
||||
"${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME"
|
||||
|
||||
# readme and license
|
||||
# manpage, readme and license
|
||||
cp "doc/$PROJECT_NAME.1" "$tempdir/$package_name"
|
||||
cp README.md "$tempdir/$package_name"
|
||||
cp LICENSE-MIT "$tempdir/$package_name"
|
||||
cp LICENSE-APACHE "$tempdir/$package_name"
|
||||
|
||||
# various autocomplete
|
||||
# TODO: disabled for now, see issue #372
|
||||
# cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion"
|
||||
# cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete"
|
||||
cp assets/completions/bat.fish "$tempdir/$package_name/autocomplete"
|
||||
# cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete"
|
||||
|
||||
# archiving
|
||||
pushd "$tempdir"
|
||||
tar czf "$out_dir/$package_name.tar.gz" "$package_name"/*
|
||||
@@ -41,17 +59,33 @@ make_deb() {
|
||||
local version
|
||||
local dpkgname
|
||||
local conflictname
|
||||
local gcc_prefix
|
||||
local homepage
|
||||
local maintainer
|
||||
|
||||
homepage="https://github.com/sharkdp/bat"
|
||||
maintainer="David Peter <mail@david-peter.de>"
|
||||
|
||||
case $TARGET in
|
||||
x86_64*)
|
||||
architecture=amd64
|
||||
gcc_prefix=""
|
||||
;;
|
||||
i686*)
|
||||
architecture=i386
|
||||
gcc_prefix=""
|
||||
;;
|
||||
aarch64*)
|
||||
architecture=arm64
|
||||
gcc_prefix="aarch64-linux-gnu-"
|
||||
;;
|
||||
arm*hf)
|
||||
architecture=armhf
|
||||
gcc_prefix="arm-linux-gnueabihf-"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown target" >&2
|
||||
return 1
|
||||
echo "make_deb: skipping target '${TARGET}'" >&2
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
version=${TRAVIS_TAG#v}
|
||||
@@ -67,12 +101,57 @@ make_deb() {
|
||||
|
||||
# copy the main binary
|
||||
install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
|
||||
strip "$tempdir/usr/bin/$PROJECT_NAME"
|
||||
"${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"
|
||||
|
||||
# manpage
|
||||
install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
|
||||
gzip --best "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
|
||||
|
||||
# completions
|
||||
install -Dm644 assets/completions/bat.fish "$tempdir/usr/share/fish/completions/$PROJECT_NAME.fish"
|
||||
|
||||
# readme and license
|
||||
install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
|
||||
install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"
|
||||
install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"
|
||||
cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: $PROJECT_NAME
|
||||
Source: $homepage
|
||||
|
||||
Files: *
|
||||
Copyright: $maintainer
|
||||
License: Apache-2.0 or MIT
|
||||
|
||||
License: Apache-2.0
|
||||
On Debian systems, the complete text of the Apache-2.0 can be found in the
|
||||
file /usr/share/common-licenses/Apache-2.0.
|
||||
|
||||
License: MIT
|
||||
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 to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
EOF
|
||||
|
||||
# Control file
|
||||
mkdir "$tempdir/DEBIAN"
|
||||
@@ -86,6 +165,7 @@ Architecture: $architecture
|
||||
Provides: $PROJECT_NAME
|
||||
Conflicts: $conflictname
|
||||
Description: A cat(1) clone with wings.
|
||||
A cat(1) clone with syntax highlighting and Git integration.
|
||||
EOF
|
||||
|
||||
fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"
|
||||
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
# This script takes care of packaging the build artifacts that will go in the
|
||||
# release zipfile
|
||||
|
||||
$SRC_DIR = $PWD.Path
|
||||
$STAGE = [System.Guid]::NewGuid().ToString()
|
||||
|
||||
Set-Location $ENV:Temp
|
||||
New-Item -Type Directory -Name $STAGE
|
||||
Set-Location $STAGE
|
||||
|
||||
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
|
||||
|
||||
Copy-Item "$SRC_DIR\target\release\bat.exe" '.\'
|
||||
# TODO: disabled for now, see issue #372
|
||||
# Copy-Item $SRC_DIR\target\release\build\bat-*\out\_bat.ps1 '.\'
|
||||
|
||||
# readme and license
|
||||
Copy-Item $SRC_DIR\README.md '.\'
|
||||
Copy-Item $SRC_DIR\LICENSE-MIT '.\'
|
||||
Copy-Item $SRC_DIR\LICENSE-APACHE '.\'
|
||||
|
||||
7z a "$ZIP" *
|
||||
|
||||
Push-AppveyorArtifact "$ZIP"
|
||||
|
||||
Set-Location ..
|
||||
Remove-Item $STAGE -Force -Recurse
|
||||
Set-Location $SRC_DIR
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" != linux ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
# needed for musl targets
|
||||
sudo apt-get install -y musl-tools
|
||||
|
||||
# needed to build deb packages
|
||||
sudo apt-get install -y fakeroot
|
||||
|
||||
# needed for i686 linux gnu target
|
||||
if [[ $TARGET == i686-unknown-linux-gnu ]]; then
|
||||
sudo apt-get install -y gcc-multilib
|
||||
fi
|
||||
|
||||
# needed for cross-compiling for arm
|
||||
if [[ $TARGET == arm-unknown-linux-gnueabihf ]]; then
|
||||
sudo apt-get install -y \
|
||||
gcc-4.8-arm-linux-gnueabihf \
|
||||
binutils-arm-linux-gnueabihf \
|
||||
libc6-armhf-cross \
|
||||
libc6-dev-armhf-cross
|
||||
fi
|
||||
|
||||
# needed for cross-compiling for arm64
|
||||
if [[ $TARGET == aarch64-unknown-linux-gnu ]]; then
|
||||
sudo apt-get install -y \
|
||||
gcc-4.8-aarch64-linux-gnu \
|
||||
binutils-aarch64-linux-gnu \
|
||||
gcc-aarch64-linux-gnu \
|
||||
libc6-dev-arm64-cross
|
||||
fi
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
# Incorporate TARGET env var to the build and test process
|
||||
cargo build --target "$TARGET" --verbose
|
||||
|
||||
# We cannot run arm executables on linux
|
||||
if [[ $TARGET != arm-unknown-linux-gnueabihf ]] && [[ $TARGET != aarch64-unknown-linux-gnu ]]; then
|
||||
cargo test --target "$TARGET" --verbose
|
||||
|
||||
# Run 'bat' on its own source code and the README
|
||||
cargo run --target "$TARGET" -- src/main.rs README.md --paging=never
|
||||
fi
|
||||
@@ -0,0 +1,455 @@
|
||||
<p align="center">
|
||||
<img src="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>
|
||||
|
||||
<p align="center">
|
||||
<a href="#syntax-highlighting">特徴</a> •
|
||||
<a href="#how-to-use">使い方</a> •
|
||||
<a href="#installation">インストール</a> •
|
||||
<a href="#customization">カスタマイズ</a> •
|
||||
<a href="#project-goals-and-alternatives">プロジェクトの目標と既存の類似したOSS</a> •
|
||||
翻訳 [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="README-ja">日本文</a>]
|
||||
</p>
|
||||
|
||||
### シンタックスハイライト
|
||||
|
||||
`bat` は多くのプログラミング言語やマークアップ言語のシンタックスハイライトに対応しています。
|
||||
|
||||

|
||||
|
||||
### Gitの統合
|
||||
|
||||
|
||||
`bat` は `git` とも連携しており、差分を表現する記号が表示されます(図の左端):
|
||||
|
||||

|
||||
|
||||
### 空白文字の可視化
|
||||
|
||||
`-A`/`--show-all` オプションをつけることで、空白文字を可視化できます:
|
||||
|
||||

|
||||
|
||||
### 自動呼び出し
|
||||
|
||||
出力が1つの画面に対して大きすぎる場合、`bat` は自身の出力を `less` にパイプで繋げることが可能です。
|
||||
|
||||
### ファイルの連結
|
||||
|
||||
あなたはさらにファイルを連結させるに使うことも可能です:wink:。
|
||||
`bat` は非対話型のターミナルを検出すると、いつでも `cat` の完全互換として振る舞い、
|
||||
プレーンなファイルを表示します。
|
||||
|
||||
## 使い方
|
||||
|
||||
単一のファイルを表示させたい
|
||||
|
||||
```bash
|
||||
> bat README.md
|
||||
```
|
||||
|
||||
複数のファイルを一度に表示させたい場合
|
||||
|
||||
```bash
|
||||
> bat src/*.rs
|
||||
```
|
||||
|
||||
標準入力から自動的に構文を決定させたい場合
|
||||
|
||||
```bash
|
||||
> curl -s https://sh.rustup.rs | bat
|
||||
```
|
||||
|
||||
Read from stdin, specify the language explicitly
|
||||
標準入力から明示的に言語を指定したい場合
|
||||
|
||||
```bash
|
||||
> yaml2json .travis.yml | json_pp | bat -l json
|
||||
```
|
||||
|
||||
空白文字を可視化させたい場合:
|
||||
```bash
|
||||
> bat -A /etc/hosts
|
||||
```
|
||||
|
||||
`cat` の代わりに `bat` を使用する際の例:
|
||||
|
||||
```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'.
|
||||
```
|
||||
|
||||
## インストール
|
||||
|
||||
### Ubuntu
|
||||
*... や他のDebianベースのLinuxディストリビューション*
|
||||
|
||||
最新の `.deb` パッケージを[こちら](https://github.com/sharkdp/bat/releases)からダウンロードして、インストールしてください:
|
||||
|
||||
``` bash
|
||||
sudo dpkg -i bat_0.12.0_amd64.deb # adapt version number and architecture
|
||||
```
|
||||
|
||||
### Arch Linux
|
||||
|
||||
[Arch Linuxの公式リソース](https://www.archlinux.org/packages/community/x86_64/bat/)からインストールできます。
|
||||
|
||||
```bash
|
||||
pacman -S bat
|
||||
```
|
||||
|
||||
### Void Linux
|
||||
|
||||
xbps-ininstall経由で `bat` をインストールできます。
|
||||
|
||||
```
|
||||
xbps-install -S bat
|
||||
```
|
||||
|
||||
### Fedora
|
||||
|
||||
[Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/)経由で `bat` をインストールできます。これはFedora 29以上ではデフォルトで有効化されています。 もしそうでなければ、 `dnf install fedora-repos-modular` を実行してセットアップし、 `fedora-modular` と `fedora-updates-modular` が `/etc/yum.repos.d` で有効化されていることを確認してください。
|
||||
|
||||
```bash
|
||||
dnf module install bat
|
||||
```
|
||||
|
||||
### Gentoo Linux
|
||||
|
||||
[Gentoo Linuxの公式リソース](https://packages.gentoo.org/packages/sys-apps/bat)からインストールできます。
|
||||
|
||||
```bash
|
||||
emerge sys-apps/bat
|
||||
```
|
||||
|
||||
### FreeBSD
|
||||
|
||||
事前にコンパイル済みである[pkg](https://www.freshports.org/textproc/bat)をインストールできます:
|
||||
|
||||
```bash
|
||||
pkg install bat
|
||||
```
|
||||
|
||||
または、FreeBSDのportsから自身でビルドすることも可能です:
|
||||
|
||||
```bash
|
||||
cd /usr/ports/textproc/bat
|
||||
make install
|
||||
```
|
||||
|
||||
### nix
|
||||
|
||||
`bat` を[nix package manager](https://nixos.org/nix)経由でインストールすることができます:
|
||||
|
||||
```bash
|
||||
nix-env -i bat
|
||||
```
|
||||
|
||||
### openSUSE
|
||||
|
||||
You can install `bat` with zypper:
|
||||
|
||||
`bat` をzypperでインストールすることができます:
|
||||
|
||||
```
|
||||
zypper install bat
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
[Homebrew](http://braumeister.org/formula/bat)でインストールすることができます:
|
||||
|
||||
|
||||
```bash
|
||||
brew install bat
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
You can download prebuilt binaries from the [Release page],
|
||||
or install it with :
|
||||
|
||||
事前にビルド済みのバイナリを[リリースページ](https://github.com/sharkdp/bat/releases)からダウンロードすることができます。または、[scoop](https://scoop.sh/)でインストールすることも可能です。
|
||||
|
||||
```bash
|
||||
scoop install bat
|
||||
```
|
||||
|
||||
[See below](#using-bat-on-windows) for notes.
|
||||
|
||||
### Docker
|
||||
|
||||
|
||||
コンテナ内で`bat` を使いたい方のために[Docker image](https://hub.docker.com/r/danlynn/bat/)が用意されています。
|
||||
|
||||
```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'
|
||||
```
|
||||
|
||||
### Ansible
|
||||
|
||||
[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)
|
||||
|
||||
これは以下のディストリビューションで動作するはずです:
|
||||
- Debian/Ubuntu
|
||||
- ARM (eg. Raspberry PI)
|
||||
- Arch Linux
|
||||
- Void Linux
|
||||
- FreeBSD
|
||||
- MacOS
|
||||
|
||||
### From binaries
|
||||
|
||||
|
||||
多くの異なるアーキテクチャのためのプレビルドバージョンを[リリースページ](https://github.com/sharkdp/bat/releases)からチェックしてみてください。静的にリンクされている多くのバイナリも利用できます: ファイル名に `musl` を含むアーカイブを探します。
|
||||
|
||||
### From source
|
||||
|
||||
|
||||
`bat` をソースからビルドしたいならば、Rust 1.29 以上の環境が必要です。そして、 `cargo` をビルドに対して使用します:
|
||||
|
||||
```bash
|
||||
cargo install bat
|
||||
```
|
||||
|
||||
|
||||
`cmake` と `libz` 開発パッケージ(`libz-dev` または `libz-devel`)が正しくビルドをするためにインストールする必要があるかもしれません。
|
||||
|
||||
## カスタマイズ
|
||||
|
||||
### ハイライト テーマ
|
||||
|
||||
`bat --list-themes` を使うと現在利用可能なシンタックスハイライトのテーマを入手できます。 `TwoDark` テーマを選ぶためには `--theme=TwoDark` オプションをつけるか `BAT_THEME` という環境変数に `TwoDark` を代入する必要があります。 シェルの起動ファイルに `export BAT_THEME="TwoDark"` と定義すればその設定が変わることはないでしょう。あるいは、 `bat` の[設定ファイル](https://github.com/sharkdp/bat#configuration-file)を利用してください。
|
||||
|
||||
|
||||
もし、ファイルにより異なるテーマを利用したい場合は、以下の[`fzf`](https://github.com/junegunn/fzf)を利用した以下のコマンドを使うことができます:
|
||||
``` bash
|
||||
bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
|
||||
```
|
||||
|
||||
`bat` はデフォルトだと黒い背景色のターミナルに適しています。しかし、`GitHub` や `OneHalfLight` のような白い背景色のテーマでもいい感じにすることができます。
|
||||
以下のカスタムテーマを参考にしてみてください。
|
||||
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes)
|
||||
|
||||
### 出力のスタイル
|
||||
|
||||
`--style` を使うことで `bat` の表示の見た目を変更することができます。例えば、 `--style=numbers,changes` と入力します。すると、Gitの差分と行番号だけが表示され、グリッド線とファイルヘッダーは表示されません。
|
||||
環境変数に `BAT_STYLE` を定義するとこれらの設定を永続的に使用することができます。
|
||||
[設定ファイル](https://github.com/sharkdp/bat#configuration-file)を参考にしても良いでしょう。
|
||||
|
||||
### 新しい構文の追加 / 言語の定義
|
||||
|
||||
`bat` はシンタックスハイライトのための[`syntext`](https://github.com/trishume/syntect/)という最高にイケてるライブラリを使用しています。`syntect` はSublime Textのために作られた[`.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)テーマです。新しい構文を定義するために以下の手順を行います。
|
||||
|
||||
構文定義ファイルを入れておくためのフォルダを作る:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
次のコマンドを使用して、これらのファイルをバイナリキャッシュに解析します:
|
||||
|
||||
```bash
|
||||
bat cache --build
|
||||
```
|
||||
|
||||
最後に `bat --list-languages` と入力すると新しい言語が利用可能かどうかチェックします。
|
||||
デフォルトの設定に戻したいときは以下のコマンドを実行します:
|
||||
|
||||
```bash
|
||||
bat cache --clear
|
||||
```
|
||||
|
||||
### 新しいテーマの追加
|
||||
|
||||
これは構文を新しく定義するやり方と非常に似ています。
|
||||
|
||||
まず、新しいシンタックスハイライトのテーマのフォルダを作ります:
|
||||
```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
|
||||
```
|
||||
|
||||
最後に、 `bat --list-themes` で新しいテーマが利用可能がチェックします
|
||||
|
||||
### 異なるページャーの使用
|
||||
|
||||
`bat` は環境変数 `PAGER` に使用するページャーを明記します。
|
||||
この環境変数が定義されていない場合、デフォルトで `less` が使用されます。もし、異なるページャーが使用したい場合は、`PAGER` を修正してください。または、`PAGER` を上書きする環境変数として `BAT_PAGER` を定義することも可能です。
|
||||
|
||||
もし、ページャーにコマンドライン引数を渡したい場合は、 `PAGER`/`BAT_PAGER` 環境変数を定義してください:
|
||||
```bash
|
||||
export BAT_PAGER="less -RF"
|
||||
```
|
||||
|
||||
環境変数を利用する代わりに、 `bat` の[設定ファイル](https://github.com/sharkdp/bat#configuration-file)の `--pager` オプションを使用することも可能です。
|
||||
|
||||
**注意**: デフォルトにより、ページャーが `less` にセットされているならば `bat` は以下のコマンドラインを受け付けるでしょう。
|
||||
ページャーのオプション: `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` , `-X`/`--no-init`
|
||||
最初の `-R` はANSIカラーを正しく解釈するために必要です。2番目の `-F` は出力サイズがターミナルの縦のサイズよりも小さいならば `less` に即座に終了するように命令します。したがって、少量のファイルのためにページャーを終了する `q` を押す必要がありません。3番目のオプションの `-X` は `less` の古いバージョンの機能である `--quit-if-one-screen` でバグを修正するために必要です。運の悪いことに、これは `less` のマウス-ホイールのサポートを無効にします。もし、マウス-ホイール スクローリングを有効にしたいなら、`-R` だけをオプションとしてつけてください(ただし、これは `--quit-if-one-screen` を無効にするでしょう)。または、 `less` の最近バージョンを利用し、 `-RF` をつけてください。 これは望ましいことに `--quit-if-one-screen` と マウス-ホイールスクローリングの両方を有効にするでしょう。
|
||||
|
||||
スクロールが未だ動作しないのであれば、加えて `-S` オプションを追加してみてください。
|
||||
|
||||
## 設定ファイル
|
||||
|
||||
|
||||
`bat` は設定ファイルでカスタマイズすることが可能です。ファイルの場所はOSに依存します。使用しているOSのデフォルトパスを調べるには以下のコマンドを実行してください:
|
||||
```
|
||||
bat --config-file
|
||||
```
|
||||
|
||||
また、環境変数 `BAT_CONFIG_PATH` に設定ファイルの場所を明記することもできます:
|
||||
```bash
|
||||
export BAT_CONFIG_PATH="/path/to/bat.conf"
|
||||
```
|
||||
|
||||
### フォーマット
|
||||
|
||||
|
||||
この設定ファイルはコマンドライン引数の単純なリストです。 `bat --help` を利用すると、利用可能なオプションとその値を閲覧することができます。さらに、`#` でコメント文を加えることができます。
|
||||
|
||||
設定ファイルの例:
|
||||
```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
|
||||
```
|
||||
|
||||
## Windows での `bat` の利用
|
||||
|
||||
Windows 上で `bat` はほとんど動作しますが、いくつかの機能は設定を必要をする場合があります。
|
||||
|
||||
### ページング
|
||||
|
||||
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).
|
||||
|
||||
|
||||
|
||||
### 色
|
||||
|
||||
Windows 10 は[v1151](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update))からbashの新しいバージョンと同様に `conhost.exe`(コマンドプロンプト)と PowerShell の色をネイティブサポートしていません。Windows の新しいバージョンでは、[Cmder](http://cmder.net/)を使うことができます。これは[ConEmu](https://conemu.github.io/)を含んでいます。
|
||||
|
||||
**注意:** Git と MSYS の `less` はWindows上で色を正しく解釈しません。もし、あなたが他のページャーをインストールしていないのであれば、 `--paging=never` オプションを付け加えるまたは `BAT_PAGER` に空文字を設定することでページングを完全に無効にできます。
|
||||
|
||||
### Cygwin
|
||||
|
||||
Windows上の `bat` は Cygwin のunix風のpath(`/cygdrive/*`)をネイティブサポートしていません。
|
||||
絶対的なcygwinパスを引数として受けたときに、 `bat` は以下のエラーを返すでしょう: `The system cannot find the path specified. (os error 3)`
|
||||
|
||||
wrapperを作成するまたは以下の関数を `.bash_profile` に追記することでこの問題を解決することができます:
|
||||
```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[@]}"
|
||||
}
|
||||
```
|
||||
|
||||
## トラブルシューティング
|
||||
|
||||
### ターミナルと色
|
||||
|
||||
`bat` はターミナルがトゥルーカラーをサポートしている/していない関係なくサポートします。しかし、シンタックスハイライトのテーマの色が8-bitカラーに最適化されていない場合、24-bitであるトゥルーカラーをサポートしているターミナルを使用することを強く推奨します(`terminator`, `konsole`, `iTerm2`, ...)。
|
||||
この[記事](https://gist.github.com/XVilka/8346728)には24-bitカラーがサポートされているターミナルの一覧が掲載されています。
|
||||
|
||||
本当の色をターミナルにセットするために、環境変数 `COLORTERM` に `truecolor` か `24bit` のどちらかを代入してください。さもなければ、 `bat` はどの色を使うのか決定することができません。または、24-bit エスケープシーケンスがサポートされません(そして、8-bit colorに戻ります)。
|
||||
|
||||
### 行番号とグリッド線がほとんど見えない
|
||||
|
||||
異なるテーマを試してみてください(`bat --list-themes` でテーマを閲覧できます)。 `OneHalfDark` と `OneHalfLight` テーマはグリッド線と線の色を明るくします。
|
||||
|
||||
|
||||
## 開発
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
## プロジェクトの目標と既存の類似したOSS
|
||||
|
||||
`bat` は以下の目標を達成しようと試みています:
|
||||
|
||||
- 美しい高度なシンタックスハイライトの提供
|
||||
- ファイルの差分を表示するためのGitとの連携
|
||||
- (POSIX) `cat` との完全互換
|
||||
- ユーザーフレンドリーがコマンドラインインターフェースの提供
|
||||
|
||||
既存の類似したOSSはたくさんあります。
|
||||
`bat` とこれらを比較した表が[こちら](alternatives.md)にあります。
|
||||
+6
-2
@@ -6,10 +6,10 @@ if you are not looking for a program like `bat`, this comparison might not be fo
|
||||
|
||||
| | bat | [pygments](http://pygments.org/) | [highlight](http://www.andre-simon.de/doku/highlight/highlight.php) | [ccat](https://github.com/jingweno/ccat) | [source-highlight](https://www.gnu.org/software/src-highlite/) | [hicat](https://github.com/rstacruz/hicat) | [coderay](https://github.com/rubychan/coderay) | [rouge](https://github.com/jneen/rouge) |
|
||||
|----------------------------------------------|---------------------------------------------------------------------|----------------------------------|---------------------------------------------------------------------|------------------------------------------|----------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------|
|
||||
| Drop-in `cat` replacement | (:heavy_check_mark:) [*](https://github.com/sharkdp/bat/issues/134) | :x: | :x: | (:heavy_check_mark:) | :x: | :x: [*](https://github.com/rstacruz/hicat/issues/6) | :x: | :x: |
|
||||
| Drop-in `cat` replacement | :heavy_check_mark: [*](https://github.com/sharkdp/bat/issues/134) | :x: | :x: | (:heavy_check_mark:) | :x: | :x: [*](https://github.com/rstacruz/hicat/issues/6) | :x: | :x: |
|
||||
| Git integration | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
|
||||
| Automatic paging | :heavy_check_mark: | :x: | :x: | :x: | :x: | :heavy_check_mark: | :x: | :x: |
|
||||
| Languages (circa) | 60 | 300 | 200 | 7 | 80 | 130 | 30 | 130 |
|
||||
| Languages (circa) | 110 | 300 | 200 | 7 | 80 | 130 | 30 | 130 |
|
||||
| Extensible (languages, themes) | :heavy_check_mark: | (:heavy_check_mark:) | (:heavy_check_mark:) | :x: | (:heavy_check_mark:) | :x: | :x: | :x: |
|
||||
| Advanced highlighting (e.g. nested syntaxes) | :heavy_check_mark: | :heavy_check_mark: | (:heavy_check_mark:) ? | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| Execution time [ms] (`jquery-3.3.1.js`) | 624 | 789 | 400 | 80 | 300 | 316 | 157 | 695 |
|
||||
@@ -18,3 +18,7 @@ if you are not looking for a program like `bat`, this comparison might not be fo
|
||||
|
||||
If you think that some entries in this table are outdated or wrong, please open a ticket or pull
|
||||
request.
|
||||
|
||||
Some other alternatives that are also related, but not yet included in the table:
|
||||
- [lesspipe](https://github.com/wofr06/lesspipe)
|
||||
- [vimpager](https://github.com/rkitover/vimpager)
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
.TH BAT "1"
|
||||
.SH NAME
|
||||
bat \- manual page for bat
|
||||
.SH DESCRIPTION
|
||||
bat - a cat(1) clone with syntax highlighting and Git integration.
|
||||
.SH "USAGE"
|
||||
.IP
|
||||
bat [OPTIONS] [FILE]...
|
||||
.IP
|
||||
bat <SUBCOMMAND>
|
||||
.SH "OPTIONS"
|
||||
.HP
|
||||
General remarks
|
||||
.IP
|
||||
Command-line options like '-l'/'--language' that take values can be specified as
|
||||
either '--language value', '--language=value', '-l value' or '-lvalue'.
|
||||
.HP
|
||||
\fB\-l\fR, \fB\-\-language\fR <language>
|
||||
.IP
|
||||
Explicitly set the language for syntax highlighting. The language can be
|
||||
specified as a name (like 'C++' or 'LaTeX') or possible file extension
|
||||
(like 'cpp', 'hpp' or 'md'). Use '\-\-list\-languages' to show all supported
|
||||
language names and file extensions.
|
||||
.HP
|
||||
\fB\-L\fR, \fB\-\-list\-languages\fR
|
||||
.IP
|
||||
Display a list of supported languages for syntax highlighting.
|
||||
.HP
|
||||
\fB\-m\fR, \fB\-\-map\-syntax\fR <from:to>...
|
||||
.IP
|
||||
Map a file extension or file name to an existing syntax. For example, to
|
||||
highlight *.conf files with the INI syntax, use '\-m conf:ini'. To
|
||||
highlight files named '.myignore' with the Git Ignore syntax, use '\-m
|
||||
\&.myignore:gitignore'.
|
||||
.HP
|
||||
\fB\-\-theme\fR <theme>
|
||||
.IP
|
||||
Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all
|
||||
available themes. To set a default theme, add the '\-\-theme="..."' option
|
||||
to the configuration file or export the BAT_THEME environment variable
|
||||
(e.g.: export BAT_THEME="...").
|
||||
.HP
|
||||
\fB\-\-list\-themes\fR
|
||||
.IP
|
||||
Display a list of supported themes for syntax highlighting.
|
||||
.HP
|
||||
\fB\-\-style\fR <style\-components>
|
||||
.IP
|
||||
Configure which elements (line numbers, file headers, grid borders, Git
|
||||
modifications, ..) to display in addition to the file contents. The
|
||||
argument is a comma\-separated list of components to display (e.g.
|
||||
\&'numbers,changes,grid') or a pre\-defined style ('full'). To set a default
|
||||
style, add the '\-\-style=".."' option to the configuration file or export
|
||||
the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
|
||||
values: *auto*, full, plain, changes, header, grid, numbers, snip.
|
||||
.HP
|
||||
\fB\-p\fR, \fB\-\-plain\fR
|
||||
.IP
|
||||
Only show plain style, no decorations. This is an alias for
|
||||
\&'\-\-style=plain'. When '\-p' is used twice ('\-pp'), it also disables
|
||||
automatic paging (alias for '\-\-style=plain \fB\-\-pager\fR=\fI\,never\/\fR').
|
||||
.HP
|
||||
\fB\-n\fR, \fB\-\-number\fR
|
||||
.IP
|
||||
Only show line numbers, no other decorations. This is an alias for
|
||||
\&'\-\-style=numbers'
|
||||
.HP
|
||||
\fB\-A\fR, \fB\-\-show\-all\fR
|
||||
.IP
|
||||
Show non\-printable characters like space, tab or newline. Use '\-\-tabs' to
|
||||
control the width of the tab\-placeholders.
|
||||
.HP
|
||||
\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
|
||||
.IP
|
||||
Only print the specified range of lines for each file. For example:
|
||||
.RS
|
||||
.IP "\-\-line\-range 30:40"
|
||||
prints lines 30 to 40
|
||||
.IP "\-\-line\-range :40"
|
||||
prints lines 1 to 40
|
||||
.IP "\-\-line\-range 40:"
|
||||
prints lines 40 to the end of the file
|
||||
.RE
|
||||
.HP
|
||||
\fB\-H\fR, \fB\-\-highlight\-line\fR <N>...
|
||||
.IP
|
||||
Highlight the N\-th line with a different background color
|
||||
.HP
|
||||
\fB\-\-color\fR <when>
|
||||
.IP
|
||||
Specify when to use colored output. The automatic mode only enables colors
|
||||
if an interactive terminal is detected. Possible values: *auto*, never,
|
||||
always.
|
||||
.HP
|
||||
\fB\-\-italic\-text\fR <when>
|
||||
.IP
|
||||
Specify when to use ANSI sequences for italic text in the output. Possible
|
||||
values: always, *never*.
|
||||
.HP
|
||||
\fB\-\-decorations\fR <when>
|
||||
.IP
|
||||
Specify when to use the decorations that have been specified via
|
||||
\&'\-\-style'. The automatic mode only enables decorations if an interactive
|
||||
terminal is detected. Possible values: *auto*, never, always.
|
||||
.HP
|
||||
\fB\-\-paging\fR <when>
|
||||
.IP
|
||||
Specify when to use the pager. To control which pager is used, set the
|
||||
PAGER or BAT_PAGER environment variables (the latter takes precedence) or
|
||||
use the '\-\-pager' option. To disable the pager permanently, set BAT_PAGER
|
||||
to an empty string or set '\-\-paging=never' in the configuration file.
|
||||
Possible values: *auto*, never, always.
|
||||
.HP
|
||||
\fB\-\-pager\fR <command>
|
||||
.IP
|
||||
Determine which pager is used. This option will overwrite the PAGER and
|
||||
BAT_PAGER environment variables. The default pager is 'less'. To disable
|
||||
the pager completely, use the '\-\-paging' option. Example: '\-\-pager "less
|
||||
\fB\-RF\fR"'.
|
||||
.HP
|
||||
\fB\-\-wrap\fR <mode>
|
||||
.IP
|
||||
Specify the text\-wrapping mode (*auto*, never, character). The
|
||||
\&'\-\-terminal\-width' option can be used in addition to control the output
|
||||
width.
|
||||
.HP
|
||||
\fB\-\-tabs\fR <T>
|
||||
.IP
|
||||
Set the tab width to T spaces. Use a width of 0 to pass tabs through
|
||||
directly
|
||||
.HP
|
||||
\fB\-u\fR, \fB\-\-unbuffered\fR
|
||||
.IP
|
||||
This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered').
|
||||
The output is always unbuffered \- this option is simply ignored.
|
||||
.HP
|
||||
\fB\-\-terminal\-width\fR <width>
|
||||
.IP
|
||||
Explicitly set the width of the terminal instead of determining it
|
||||
automatically. If prefixed with '+' or '\-', the value will be treated as
|
||||
an offset to the actual terminal width. See also: '\-\-wrap'.
|
||||
.HP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
.IP
|
||||
Print this help message.
|
||||
.HP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
.IP
|
||||
Show version information.
|
||||
.SH "ARGS"
|
||||
.IP
|
||||
<FILE>...
|
||||
.IP
|
||||
File(s) to print / concatenate. Use a dash ('\-') or no argument at all to read
|
||||
from standard input.
|
||||
.SH "SUBCOMMANDS"
|
||||
.IP
|
||||
cache
|
||||
Modify the syntax\-definition and theme cache
|
||||
+278
-274
@@ -1,255 +1,152 @@
|
||||
use atty::{self, Stream};
|
||||
use clap::{App as ClapApp, AppSettings, Arg, ArgGroup, ArgMatches, SubCommand};
|
||||
use console::Term;
|
||||
use errors::*;
|
||||
use std::collections::HashSet;
|
||||
use std::env;
|
||||
use style::{OutputComponent, OutputComponents, OutputWrap};
|
||||
use std::str::FromStr;
|
||||
|
||||
use atty::{self, Stream};
|
||||
|
||||
use crate::clap_app;
|
||||
use clap::ArgMatches;
|
||||
use wild;
|
||||
|
||||
use console::Term;
|
||||
|
||||
#[cfg(windows)]
|
||||
use ansi_term;
|
||||
|
||||
use crate::assets::BAT_THEME_DEFAULT;
|
||||
use crate::config::{get_args_from_config_file, get_args_from_env_var};
|
||||
use crate::errors::*;
|
||||
use crate::inputfile::InputFile;
|
||||
use crate::line_range::{LineRange, LineRanges};
|
||||
use crate::style::{OutputComponent, OutputComponents, OutputWrap};
|
||||
use crate::syntax_mapping::SyntaxMapping;
|
||||
use crate::util::transpose;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum PagingMode {
|
||||
Always,
|
||||
QuitIfOneScreen,
|
||||
Never,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Config<'a> {
|
||||
/// List of files to print
|
||||
pub files: Vec<InputFile<'a>>,
|
||||
|
||||
/// The explicitly configured language, if any
|
||||
pub language: Option<&'a str>,
|
||||
|
||||
/// Whether or not to show/replace non-printable characters like space, tab and newline.
|
||||
pub show_nonprintable: bool,
|
||||
|
||||
/// The character width of the terminal
|
||||
pub term_width: usize,
|
||||
|
||||
/// The width of tab characters.
|
||||
/// Currently, a value of 0 will cause tabs to be passed through without expanding them.
|
||||
pub tab_width: usize,
|
||||
|
||||
/// Whether or not to simply loop through all input (`cat` mode)
|
||||
pub loop_through: bool,
|
||||
|
||||
/// Whether or not the output should be colorized
|
||||
pub colored_output: bool,
|
||||
|
||||
/// Whether or not the output terminal supports true color
|
||||
pub true_color: bool,
|
||||
|
||||
/// Style elements (grid, line numbers, ...)
|
||||
pub output_components: OutputComponents,
|
||||
|
||||
/// Text wrapping mode
|
||||
pub output_wrap: OutputWrap,
|
||||
|
||||
/// Pager or STDOUT
|
||||
pub paging_mode: PagingMode,
|
||||
|
||||
/// Specifies the lines that should be printed
|
||||
pub line_ranges: LineRanges,
|
||||
|
||||
/// The syntax highlighting theme
|
||||
pub theme: String,
|
||||
|
||||
/// File extension/name mappings
|
||||
pub syntax_mapping: SyntaxMapping,
|
||||
|
||||
/// Command to start the pager
|
||||
pub pager: Option<&'a str>,
|
||||
|
||||
/// Whether or not to use ANSI italics
|
||||
pub use_italic_text: bool,
|
||||
|
||||
/// Lines to highlight
|
||||
pub highlight_lines: Vec<usize>,
|
||||
}
|
||||
|
||||
fn is_truecolor_terminal() -> bool {
|
||||
env::var("COLORTERM")
|
||||
.map(|colorterm| colorterm == "truecolor" || colorterm == "24bit")
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub struct App {
|
||||
pub matches: ArgMatches<'static>,
|
||||
interactive_output: bool,
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub fn new() -> Self {
|
||||
pub fn new() -> Result<Self> {
|
||||
#[cfg(windows)]
|
||||
let _ = ansi_term::enable_ansi_support();
|
||||
|
||||
let interactive_output = atty::is(Stream::Stdout);
|
||||
|
||||
#[cfg(windows)]
|
||||
let interactive_output = interactive_output && ansi_term::enable_ansi_support().is_ok();
|
||||
|
||||
App {
|
||||
matches: Self::matches(interactive_output),
|
||||
Ok(App {
|
||||
matches: Self::matches(interactive_output)?,
|
||||
interactive_output,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn matches(interactive_output: bool) -> ArgMatches<'static> {
|
||||
let clap_color_setting = if interactive_output {
|
||||
AppSettings::ColoredHelp
|
||||
fn matches(interactive_output: bool) -> Result<ArgMatches<'static>> {
|
||||
let args = if wild::args_os().nth(1) == Some("cache".into())
|
||||
|| wild::args_os().any(|arg| arg == "--no-config")
|
||||
{
|
||||
// Skip the arguments in bats config file
|
||||
|
||||
wild::args_os().collect::<Vec<_>>()
|
||||
} else {
|
||||
AppSettings::ColorNever
|
||||
let mut cli_args = wild::args_os();
|
||||
|
||||
// Read arguments from bats config file
|
||||
let mut args = get_args_from_env_var()
|
||||
.unwrap_or_else(get_args_from_config_file)
|
||||
.chain_err(|| "Could not parse configuration file")?;
|
||||
|
||||
// Put the zero-th CLI argument (program name) first
|
||||
args.insert(0, cli_args.next().unwrap());
|
||||
|
||||
// .. and the rest at the end
|
||||
cli_args.for_each(|a| args.push(a));
|
||||
|
||||
args
|
||||
};
|
||||
|
||||
ClapApp::new(crate_name!())
|
||||
.version(crate_version!())
|
||||
.global_setting(clap_color_setting)
|
||||
.global_setting(AppSettings::DeriveDisplayOrder)
|
||||
.global_setting(AppSettings::UnifiedHelpMessage)
|
||||
.global_setting(AppSettings::NextLineHelp)
|
||||
.setting(AppSettings::InferSubcommands)
|
||||
.setting(AppSettings::ArgsNegateSubcommands)
|
||||
.setting(AppSettings::DisableHelpSubcommand)
|
||||
.setting(AppSettings::VersionlessSubcommands)
|
||||
.max_term_width(90)
|
||||
.about(
|
||||
"A cat(1) clone with wings.\n\n\
|
||||
Use '--help' instead of '-h' to see a more detailed version of the help text.",
|
||||
)
|
||||
.long_about("A cat(1) clone with syntax highlighting and Git integration.")
|
||||
.arg(
|
||||
Arg::with_name("language")
|
||||
.short("l")
|
||||
.long("language")
|
||||
.overrides_with("language")
|
||||
.help("Set the language for highlighting")
|
||||
.long_help(
|
||||
"Set the language for syntax highlighting. The language can be \
|
||||
specified as a name (like 'C++' or 'LaTeX') or possible file \
|
||||
extension (like 'cpp', 'hpp' or 'md'). Use '--list-languages' \
|
||||
to show all supported language names and file extensions",
|
||||
)
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("FILE")
|
||||
.help("File(s) to print / concatenate. Use '-' for standard input.")
|
||||
.long_help(
|
||||
"File(s) to print. Use no argument or '-' to read from standard \
|
||||
input",
|
||||
)
|
||||
.multiple(true)
|
||||
.empty_values(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("style")
|
||||
.long("style")
|
||||
.value_name("style-components")
|
||||
.use_delimiter(true)
|
||||
.takes_value(true)
|
||||
.possible_values(&[
|
||||
"auto", "full", "plain", "changes", "header", "grid", "numbers",
|
||||
])
|
||||
.default_value("auto")
|
||||
.help("Comma-separated list of style elements to display")
|
||||
.long_help(
|
||||
"Configure which elements (line numbers, file headers, grid \
|
||||
borders, Git modifications, ..) to display in addition to the \
|
||||
file contents. The argument is a comma-separated list of \
|
||||
components to display (e.g. 'numbers,changes,grid') or a \
|
||||
pre-defined style ('full')",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("color")
|
||||
.long("color")
|
||||
.overrides_with("color")
|
||||
.takes_value(true)
|
||||
.value_name("when")
|
||||
.possible_values(&["auto", "never", "always"])
|
||||
.default_value("auto")
|
||||
.help("When to use colors"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("paging")
|
||||
.long("paging")
|
||||
.overrides_with("paging")
|
||||
.takes_value(true)
|
||||
.value_name("when")
|
||||
.possible_values(&["auto", "never", "always"])
|
||||
.default_value("auto")
|
||||
.help("When to use the pager")
|
||||
.long_help("Specify when to use the pager (less)"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("wrap")
|
||||
.long("wrap")
|
||||
.overrides_with("wrap")
|
||||
.takes_value(true)
|
||||
.value_name("mode")
|
||||
.possible_values(&["character", "never"])
|
||||
.default_value("character")
|
||||
.help("When to wrap text"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("list-languages")
|
||||
.long("list-languages")
|
||||
.help("Displays supported languages")
|
||||
.long_help("Display a list of supported languages"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("theme")
|
||||
.long("theme")
|
||||
.overrides_with("theme")
|
||||
.takes_value(true)
|
||||
.help("Set the theme for highlighting")
|
||||
.long_help(
|
||||
"Set the theme for syntax highlighting. Use '--list-themes' to \
|
||||
see all available themes",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("list-themes")
|
||||
.long("list-themes")
|
||||
.help("Displays supported themes")
|
||||
.help("Display a list of supported themes for syntax highlighting"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("number")
|
||||
.long("number")
|
||||
.overrides_with("number")
|
||||
.short("n")
|
||||
.conflicts_with("style")
|
||||
.help("Show line numbers (alias for '--style=numbers')")
|
||||
.long_help(
|
||||
"Show line numbers (no other decorations). This is an alias for \
|
||||
'--style=numbers'",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("unbuffered")
|
||||
.short("u")
|
||||
.help("(ignored)")
|
||||
// TODO: use '.hidden_short_help(true)' when the next clap version is released
|
||||
.long_help(
|
||||
"This option exists for POSIX-compliance reasons ('u' is for \
|
||||
'unbuffered'). The output is always unbuffered - this option \
|
||||
it simply ignored.",
|
||||
),
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("cache")
|
||||
.about("Modify the syntax-definition and theme cache")
|
||||
.arg(
|
||||
Arg::with_name("init")
|
||||
.long("init")
|
||||
.short("i")
|
||||
.help("Initialize the syntax/theme cache")
|
||||
.long_help(
|
||||
"Initialize the syntax/theme cache by loading from the \
|
||||
source directory (default: the configuration directory)",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("clear")
|
||||
.long("clear")
|
||||
.short("c")
|
||||
.help("Reset the cache"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("config-dir")
|
||||
.long("config-dir")
|
||||
.short("d")
|
||||
.help("Show the configuration directory"),
|
||||
)
|
||||
.group(
|
||||
ArgGroup::with_name("cache-actions")
|
||||
.args(&["init", "clear", "config-dir"])
|
||||
.required(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("source")
|
||||
.long("source")
|
||||
.requires("init")
|
||||
.takes_value(true)
|
||||
.value_name("dir")
|
||||
.help("Use a different source for loading syntaxes and themes from"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("target")
|
||||
.long("target")
|
||||
.requires("init")
|
||||
.takes_value(true)
|
||||
.value_name("dir")
|
||||
.help(
|
||||
"Use a different source to store the cached syntax and theme set",
|
||||
),
|
||||
),
|
||||
)
|
||||
.help_message("Print this help message.")
|
||||
.version_message("Show version information.")
|
||||
.get_matches()
|
||||
Ok(clap_app::build_app(interactive_output).get_matches_from(args))
|
||||
}
|
||||
|
||||
pub fn config(&self) -> Result<Config> {
|
||||
let files = self.files();
|
||||
let output_components = self.output_components()?;
|
||||
|
||||
Ok(Config {
|
||||
true_color: is_truecolor_terminal(),
|
||||
output_components: self.output_components()?,
|
||||
language: self.matches.value_of("language"),
|
||||
output_wrap: if !self.interactive_output {
|
||||
// We don't have the tty width when piping to another program.
|
||||
// There's no point in wrapping when this is the case.
|
||||
OutputWrap::None
|
||||
} else {
|
||||
match self.matches.value_of("wrap") {
|
||||
Some("character") => OutputWrap::Character,
|
||||
Some("never") | _ => OutputWrap::None,
|
||||
}
|
||||
},
|
||||
colored_output: match self.matches.value_of("color") {
|
||||
Some("always") => true,
|
||||
Some("never") => false,
|
||||
Some("auto") | _ => self.interactive_output,
|
||||
},
|
||||
paging_mode: match self.matches.value_of("paging") {
|
||||
Some("always") => PagingMode::Always,
|
||||
Some("never") => PagingMode::Never,
|
||||
Some("auto") | _ => if files.contains(&None) {
|
||||
let paging_mode = match self.matches.value_of("paging") {
|
||||
Some("always") => PagingMode::Always,
|
||||
Some("never") => PagingMode::Never,
|
||||
Some("auto") | _ => {
|
||||
if self.matches.occurrences_of("plain") > 1 {
|
||||
// If we have -pp as an option when in auto mode, the pager should be disabled.
|
||||
PagingMode::Never
|
||||
} else if files.contains(&InputFile::StdIn) {
|
||||
// If we are reading from stdin, only enable paging if we write to an
|
||||
// interactive terminal and if we do not *read* from an interactive
|
||||
// terminal.
|
||||
@@ -258,74 +155,181 @@ impl App {
|
||||
} else {
|
||||
PagingMode::Never
|
||||
}
|
||||
} else if self.interactive_output {
|
||||
PagingMode::QuitIfOneScreen
|
||||
} else {
|
||||
if self.interactive_output {
|
||||
PagingMode::QuitIfOneScreen
|
||||
} else {
|
||||
PagingMode::Never
|
||||
PagingMode::Never
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let mut syntax_mapping = SyntaxMapping::new();
|
||||
|
||||
if let Some(values) = self.matches.values_of("map-syntax") {
|
||||
for from_to in values {
|
||||
let parts: Vec<_> = from_to.split(':').collect();
|
||||
|
||||
if parts.len() != 2 {
|
||||
return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is 'from:to'.".into());
|
||||
}
|
||||
|
||||
syntax_mapping.insert(parts[0], parts[1]);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Config {
|
||||
true_color: is_truecolor_terminal(),
|
||||
language: self.matches.value_of("language").or_else(|| {
|
||||
if self.matches.is_present("show-all") {
|
||||
Some("show-nonprintable")
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}),
|
||||
show_nonprintable: self.matches.is_present("show-all"),
|
||||
output_wrap: if !self.interactive_output {
|
||||
// We don't have the tty width when piping to another program.
|
||||
// There's no point in wrapping when this is the case.
|
||||
OutputWrap::None
|
||||
} else {
|
||||
match self.matches.value_of("wrap") {
|
||||
Some("character") => OutputWrap::Character,
|
||||
Some("never") => OutputWrap::None,
|
||||
Some("auto") | _ => {
|
||||
if output_components.plain() {
|
||||
OutputWrap::None
|
||||
} else {
|
||||
OutputWrap::Character
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
term_width: Term::stdout().size().1 as usize,
|
||||
colored_output: match self.matches.value_of("color") {
|
||||
Some("always") => true,
|
||||
Some("never") => false,
|
||||
Some("auto") | _ => self.interactive_output,
|
||||
},
|
||||
paging_mode,
|
||||
term_width: self
|
||||
.matches
|
||||
.value_of("terminal-width")
|
||||
.and_then(|w| {
|
||||
if w.starts_with('+') || w.starts_with('-') {
|
||||
// Treat argument as a delta to the current terminal width
|
||||
w.parse().ok().map(|delta: i16| {
|
||||
let old_width: u16 = Term::stdout().size().1;
|
||||
let new_width: i32 = i32::from(old_width) + i32::from(delta);
|
||||
|
||||
if new_width <= 0 {
|
||||
old_width as usize
|
||||
} else {
|
||||
new_width as usize
|
||||
}
|
||||
})
|
||||
} else {
|
||||
w.parse().ok()
|
||||
}
|
||||
})
|
||||
.unwrap_or(Term::stdout().size().1 as usize),
|
||||
loop_through: !(self.interactive_output
|
||||
|| self.matches.value_of("color") == Some("always")
|
||||
|| self.matches.value_of("decorations") == Some("always")),
|
||||
files,
|
||||
theme: self.matches.value_of("theme"),
|
||||
tab_width: self
|
||||
.matches
|
||||
.value_of("tabs")
|
||||
.map(String::from)
|
||||
.or_else(|| env::var("BAT_TABS").ok())
|
||||
.and_then(|t| t.parse().ok())
|
||||
.unwrap_or(
|
||||
if output_components.plain() && paging_mode == PagingMode::Never {
|
||||
0
|
||||
} else {
|
||||
4
|
||||
},
|
||||
),
|
||||
theme: self
|
||||
.matches
|
||||
.value_of("theme")
|
||||
.map(String::from)
|
||||
.or_else(|| env::var("BAT_THEME").ok())
|
||||
.unwrap_or_else(|| String::from(BAT_THEME_DEFAULT)),
|
||||
line_ranges: LineRanges::from(
|
||||
transpose(
|
||||
self.matches
|
||||
.values_of("line-range")
|
||||
.map(|vs| vs.map(LineRange::from).collect()),
|
||||
)?
|
||||
.unwrap_or_else(|| vec![]),
|
||||
),
|
||||
output_components,
|
||||
syntax_mapping,
|
||||
pager: self.matches.value_of("pager"),
|
||||
use_italic_text: match self.matches.value_of("italic-text") {
|
||||
Some("always") => true,
|
||||
_ => false,
|
||||
},
|
||||
highlight_lines: self
|
||||
.matches
|
||||
.values_of("highlight-line")
|
||||
.and_then(|ws| ws.map(|w| w.parse().ok()).collect())
|
||||
.unwrap_or_default(),
|
||||
})
|
||||
}
|
||||
|
||||
fn files(&self) -> Vec<Option<&str>> {
|
||||
fn files(&self) -> Vec<InputFile> {
|
||||
self.matches
|
||||
.values_of("FILE")
|
||||
.map(|values| {
|
||||
values
|
||||
.map(|filename| {
|
||||
if filename == "-" {
|
||||
None
|
||||
InputFile::StdIn
|
||||
} else {
|
||||
Some(filename)
|
||||
InputFile::Ordinary(filename)
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or_else(|| vec![None]) // read from stdin (None) if no args are given
|
||||
.unwrap_or_else(|| vec![InputFile::StdIn])
|
||||
}
|
||||
|
||||
fn output_components(&self) -> Result<OutputComponents> {
|
||||
let matches = &self.matches;
|
||||
Ok(OutputComponents(if matches.is_present("number") {
|
||||
[OutputComponent::Numbers].iter().cloned().collect()
|
||||
} else {
|
||||
values_t!(matches.values_of("style"), OutputComponent)?
|
||||
.into_iter()
|
||||
.map(|style| style.components(self.interactive_output))
|
||||
.fold(HashSet::new(), |mut acc, components| {
|
||||
acc.extend(components.iter().cloned());
|
||||
acc
|
||||
})
|
||||
}))
|
||||
Ok(OutputComponents(
|
||||
if matches.value_of("decorations") == Some("never") {
|
||||
HashSet::new()
|
||||
} else if matches.is_present("number") {
|
||||
[OutputComponent::Numbers].iter().cloned().collect()
|
||||
} else if matches.is_present("plain") {
|
||||
[OutputComponent::Plain].iter().cloned().collect()
|
||||
} else {
|
||||
let env_style_components: Option<Vec<OutputComponent>> =
|
||||
transpose(env::var("BAT_STYLE").ok().map(|style_str| {
|
||||
style_str
|
||||
.split(',')
|
||||
.map(|x| OutputComponent::from_str(&x))
|
||||
.collect::<Result<Vec<OutputComponent>>>()
|
||||
}))?;
|
||||
|
||||
matches
|
||||
.value_of("style")
|
||||
.map(|styles| {
|
||||
styles
|
||||
.split(',')
|
||||
.map(|style| style.parse::<OutputComponent>())
|
||||
.filter_map(|style| style.ok())
|
||||
.collect::<Vec<_>>()
|
||||
})
|
||||
.or(env_style_components)
|
||||
.unwrap_or_else(|| vec![OutputComponent::Full])
|
||||
.into_iter()
|
||||
.map(|style| style.components(self.interactive_output))
|
||||
.fold(HashSet::new(), |mut acc, components| {
|
||||
acc.extend(components.iter().cloned());
|
||||
acc
|
||||
})
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum PagingMode {
|
||||
Always,
|
||||
QuitIfOneScreen,
|
||||
Never,
|
||||
}
|
||||
|
||||
pub struct Config<'a> {
|
||||
pub true_color: bool,
|
||||
pub output_wrap: OutputWrap,
|
||||
pub output_components: OutputComponents,
|
||||
pub language: Option<&'a str>,
|
||||
pub colored_output: bool,
|
||||
pub paging_mode: PagingMode,
|
||||
pub term_width: usize,
|
||||
pub files: Vec<Option<&'a str>>,
|
||||
pub theme: Option<&'a str>,
|
||||
}
|
||||
|
||||
fn is_truecolor_terminal() -> bool {
|
||||
env::var("COLORTERM")
|
||||
.map(|colorterm| colorterm == "truecolor" || colorterm == "24bit")
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
+104
-57
@@ -1,19 +1,20 @@
|
||||
use directories::ProjectDirs;
|
||||
use errors::*;
|
||||
use std::borrow::Cow;
|
||||
use std::collections::BTreeMap;
|
||||
use std::fs::{self, File};
|
||||
use std::io;
|
||||
use std::io::BufReader;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use syntect::dumps::{dump_to_file, from_binary, from_reader};
|
||||
use syntect::highlighting::{Theme, ThemeSet};
|
||||
use syntect::parsing::{SyntaxDefinition, SyntaxSet};
|
||||
use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder};
|
||||
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::FileTypeExt;
|
||||
use crate::dirs::PROJECT_DIRS;
|
||||
|
||||
lazy_static! {
|
||||
static ref PROJECT_DIRS: ProjectDirs = ProjectDirs::from("", "", crate_name!());
|
||||
}
|
||||
use crate::errors::*;
|
||||
use crate::inputfile::{InputFile, InputFileReader};
|
||||
use crate::syntax_mapping::SyntaxMapping;
|
||||
|
||||
pub const BAT_THEME_DEFAULT: &str = "Monokai Extended";
|
||||
|
||||
pub struct HighlightingAssets {
|
||||
pub syntax_set: SyntaxSet,
|
||||
@@ -25,29 +26,47 @@ impl HighlightingAssets {
|
||||
Self::from_cache().unwrap_or_else(|_| Self::from_binary())
|
||||
}
|
||||
|
||||
pub fn from_files(dir: Option<&Path>) -> Result<Self> {
|
||||
pub fn from_files(dir: Option<&Path>, start_empty: bool) -> Result<Self> {
|
||||
let source_dir = dir.unwrap_or_else(|| PROJECT_DIRS.config_dir());
|
||||
|
||||
let mut theme_set = if start_empty {
|
||||
ThemeSet {
|
||||
themes: BTreeMap::new(),
|
||||
}
|
||||
} else {
|
||||
Self::get_integrated_themeset()
|
||||
};
|
||||
|
||||
let theme_dir = source_dir.join("themes");
|
||||
let theme_set = ThemeSet::load_from_folder(&theme_dir).chain_err(|| {
|
||||
format!(
|
||||
"Could not load themes from '{}'",
|
||||
|
||||
let res = theme_set.add_from_folder(&theme_dir);
|
||||
if res.is_err() {
|
||||
println!(
|
||||
"No themes were found in '{}', using the default set",
|
||||
theme_dir.to_string_lossy()
|
||||
)
|
||||
})?;
|
||||
let mut syntax_set = SyntaxSet::new();
|
||||
let syntax_dir = source_dir.join("syntaxes");
|
||||
if !syntax_dir.exists() {
|
||||
return Err(format!(
|
||||
"Could not load syntaxes from '{}'",
|
||||
syntax_dir.to_string_lossy()
|
||||
).into());
|
||||
);
|
||||
}
|
||||
|
||||
let mut syntax_set_builder = if start_empty {
|
||||
let mut builder = SyntaxSetBuilder::new();
|
||||
builder.add_plain_text_syntax();
|
||||
builder
|
||||
} else {
|
||||
Self::get_integrated_syntaxset().into_builder()
|
||||
};
|
||||
|
||||
let syntax_dir = source_dir.join("syntaxes");
|
||||
if syntax_dir.exists() {
|
||||
syntax_set_builder.add_from_folder(syntax_dir, true)?;
|
||||
} else {
|
||||
println!(
|
||||
"No syntaxes were found in '{}', using the default set.",
|
||||
syntax_dir.to_string_lossy()
|
||||
);
|
||||
}
|
||||
syntax_set.load_syntaxes(syntax_dir, true)?;
|
||||
syntax_set.load_plain_text_syntax();
|
||||
|
||||
Ok(HighlightingAssets {
|
||||
syntax_set,
|
||||
syntax_set: syntax_set_builder.build(),
|
||||
theme_set,
|
||||
})
|
||||
}
|
||||
@@ -60,9 +79,8 @@ impl HighlightingAssets {
|
||||
syntax_set_path().to_string_lossy()
|
||||
)
|
||||
})?;
|
||||
let mut syntax_set: SyntaxSet =
|
||||
from_reader(syntax_set_file).chain_err(|| "Could not parse cached syntax set")?;
|
||||
syntax_set.link_syntaxes();
|
||||
let syntax_set: SyntaxSet = from_reader(BufReader::new(syntax_set_file))
|
||||
.chain_err(|| "Could not parse cached syntax set")?;
|
||||
|
||||
let theme_set_file = File::open(&theme_set_path).chain_err(|| {
|
||||
format!(
|
||||
@@ -70,8 +88,8 @@ impl HighlightingAssets {
|
||||
theme_set_path.to_string_lossy()
|
||||
)
|
||||
})?;
|
||||
let theme_set: ThemeSet =
|
||||
from_reader(theme_set_file).chain_err(|| "Could not parse cached theme set")?;
|
||||
let theme_set: ThemeSet = from_reader(BufReader::new(theme_set_file))
|
||||
.chain_err(|| "Could not parse cached theme set")?;
|
||||
|
||||
Ok(HighlightingAssets {
|
||||
syntax_set,
|
||||
@@ -79,10 +97,17 @@ impl HighlightingAssets {
|
||||
})
|
||||
}
|
||||
|
||||
fn get_integrated_syntaxset() -> SyntaxSet {
|
||||
from_binary(include_bytes!("../assets/syntaxes.bin"))
|
||||
}
|
||||
|
||||
fn get_integrated_themeset() -> ThemeSet {
|
||||
from_binary(include_bytes!("../assets/themes.bin"))
|
||||
}
|
||||
|
||||
fn from_binary() -> Self {
|
||||
let mut syntax_set: SyntaxSet = from_binary(include_bytes!("../assets/syntaxes.bin"));
|
||||
syntax_set.link_syntaxes();
|
||||
let theme_set: ThemeSet = from_binary(include_bytes!("../assets/themes.bin"));
|
||||
let syntax_set = Self::get_integrated_syntaxset();
|
||||
let theme_set = Self::get_integrated_themeset();
|
||||
|
||||
HighlightingAssets {
|
||||
syntax_set,
|
||||
@@ -92,7 +117,7 @@ impl HighlightingAssets {
|
||||
|
||||
pub fn save(&self, dir: Option<&Path>) -> Result<()> {
|
||||
let target_dir = dir.unwrap_or_else(|| PROJECT_DIRS.cache_dir());
|
||||
let _ = fs::create_dir(target_dir);
|
||||
let _ = fs::create_dir_all(target_dir);
|
||||
let theme_set_path = target_dir.join("themes.bin");
|
||||
let syntax_set_path = target_dir.join("syntaxes.bin");
|
||||
|
||||
@@ -123,38 +148,56 @@ impl HighlightingAssets {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_theme(&self, theme: &str) -> Result<&Theme> {
|
||||
Ok(self.theme_set.themes.get(theme).ok_or_else(|| {
|
||||
io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("Could not find '{}' theme", theme),
|
||||
)
|
||||
})?)
|
||||
pub fn get_theme(&self, theme: &str) -> &Theme {
|
||||
match self.theme_set.themes.get(theme) {
|
||||
Some(theme) => theme,
|
||||
None => {
|
||||
use ansi_term::Colour::Yellow;
|
||||
eprintln!(
|
||||
"{}: Unknown theme '{}', using default.",
|
||||
Yellow.paint("[bat warning]"),
|
||||
theme
|
||||
);
|
||||
&self.theme_set.themes[BAT_THEME_DEFAULT]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_syntax(&self, language: Option<&str>, filename: Option<&str>) -> &SyntaxDefinition {
|
||||
pub fn get_syntax(
|
||||
&self,
|
||||
language: Option<&str>,
|
||||
filename: InputFile,
|
||||
reader: &mut InputFileReader,
|
||||
mapping: &SyntaxMapping,
|
||||
) -> &SyntaxReference {
|
||||
let syntax = match (language, filename) {
|
||||
(Some(language), _) => self.syntax_set.find_syntax_by_token(language),
|
||||
(None, Some(filename)) => {
|
||||
#[cfg(not(unix))]
|
||||
let may_read_from_file = true;
|
||||
(None, InputFile::Ordinary(filename)) => {
|
||||
let path = Path::new(filename);
|
||||
let file_name = path.file_name().and_then(|n| n.to_str()).unwrap_or("");
|
||||
let extension = path.extension().and_then(|x| x.to_str()).unwrap_or("");
|
||||
|
||||
// Do not peek at the file (to determine the syntax) if it is a FIFO because they can
|
||||
// only be read once.
|
||||
#[cfg(unix)]
|
||||
let may_read_from_file = !fs::metadata(filename)
|
||||
.map(|m| m.file_type().is_fifo())
|
||||
.unwrap_or(false);
|
||||
let file_name = mapping.replace(file_name);
|
||||
let extension = mapping.replace(extension);
|
||||
|
||||
if may_read_from_file {
|
||||
self.syntax_set
|
||||
.find_syntax_for_file(filename)
|
||||
.unwrap_or(None)
|
||||
let ext_syntax = self
|
||||
.syntax_set
|
||||
.find_syntax_by_extension(&file_name)
|
||||
.or_else(|| self.syntax_set.find_syntax_by_extension(&extension));
|
||||
let line_syntax = if ext_syntax.is_none() {
|
||||
String::from_utf8(reader.first_line.clone())
|
||||
.ok()
|
||||
.and_then(|l| self.syntax_set.find_syntax_by_first_line(&l))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
};
|
||||
|
||||
ext_syntax.or(line_syntax)
|
||||
}
|
||||
(None, None) => None,
|
||||
(None, InputFile::StdIn) => String::from_utf8(reader.first_line.clone())
|
||||
.ok()
|
||||
.and_then(|l| self.syntax_set.find_syntax_by_first_line(&l)),
|
||||
(_, InputFile::ThemePreviewFile) => self.syntax_set.find_syntax_by_name("Rust"),
|
||||
};
|
||||
|
||||
syntax.unwrap_or_else(|| self.syntax_set.find_syntax_plain_text())
|
||||
@@ -173,6 +216,10 @@ pub fn config_dir() -> Cow<'static, str> {
|
||||
PROJECT_DIRS.config_dir().to_string_lossy()
|
||||
}
|
||||
|
||||
pub fn cache_dir() -> Cow<'static, str> {
|
||||
PROJECT_DIRS.cache_dir().to_string_lossy()
|
||||
}
|
||||
|
||||
pub fn clear_assets() {
|
||||
print!("Clearing theme set cache ... ");
|
||||
fs::remove_file(theme_set_path()).ok();
|
||||
|
||||
+432
@@ -0,0 +1,432 @@
|
||||
use clap::{App as ClapApp, AppSettings, Arg, ArgGroup, SubCommand};
|
||||
use std::path::Path;
|
||||
|
||||
pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
let clap_color_setting = if interactive_output {
|
||||
AppSettings::ColoredHelp
|
||||
} else {
|
||||
AppSettings::ColorNever
|
||||
};
|
||||
|
||||
// Check if the current directory contains a file name cache, if it does
|
||||
// do not make the arguements for subcommand 'cache' required.
|
||||
let arg_group_required = !Path::new("cache").exists();
|
||||
|
||||
ClapApp::new(crate_name!())
|
||||
.version(crate_version!())
|
||||
.global_setting(clap_color_setting)
|
||||
.global_setting(AppSettings::DeriveDisplayOrder)
|
||||
.global_setting(AppSettings::UnifiedHelpMessage)
|
||||
.global_setting(AppSettings::HidePossibleValuesInHelp)
|
||||
.setting(AppSettings::ArgsNegateSubcommands)
|
||||
.setting(AppSettings::AllowExternalSubcommands)
|
||||
.setting(AppSettings::DisableHelpSubcommand)
|
||||
.setting(AppSettings::VersionlessSubcommands)
|
||||
.max_term_width(100)
|
||||
.about(
|
||||
"A cat(1) clone with wings.\n\n\
|
||||
Use '--help' instead of '-h' to see a more detailed version of the help text.",
|
||||
)
|
||||
.long_about("A cat(1) clone with syntax highlighting and Git integration.")
|
||||
.arg(
|
||||
Arg::with_name("FILE")
|
||||
.help("File(s) to print / concatenate. Use '-' for standard input.")
|
||||
.long_help(
|
||||
"File(s) to print / concatenate. Use a dash ('-') or no argument at all \
|
||||
to read from standard input.",
|
||||
)
|
||||
.multiple(true)
|
||||
.empty_values(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("language")
|
||||
.short("l")
|
||||
.long("language")
|
||||
.overrides_with("language")
|
||||
.help("Set the language for syntax highlighting.")
|
||||
.long_help(
|
||||
"Explicitly set the language for syntax highlighting. The language can be \
|
||||
specified as a name (like 'C++' or 'LaTeX') or possible file extension \
|
||||
(like 'cpp', 'hpp' or 'md'). Use '--list-languages' to show all supported \
|
||||
language names and file extensions.",
|
||||
)
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("list-languages")
|
||||
.long("list-languages")
|
||||
.short("L")
|
||||
.conflicts_with("list-themes")
|
||||
.help("Display all supported languages.")
|
||||
.long_help("Display a list of supported languages for syntax highlighting."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("map-syntax")
|
||||
.short("m")
|
||||
.long("map-syntax")
|
||||
.multiple(true)
|
||||
.takes_value(true)
|
||||
.number_of_values(1)
|
||||
.value_name("from:to")
|
||||
.help("Map a file extension or name to an existing syntax.")
|
||||
.long_help(
|
||||
"Map a file extension or file name to an existing syntax. For example, \
|
||||
to highlight *.conf files with the INI syntax, use '-m conf:ini'. \
|
||||
To highlight files named '.myignore' with the Git Ignore syntax, use \
|
||||
'-m .myignore:gitignore'.",
|
||||
)
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("theme")
|
||||
.long("theme")
|
||||
.overrides_with("theme")
|
||||
.takes_value(true)
|
||||
.help("Set the color theme for syntax highlighting.")
|
||||
.long_help(
|
||||
"Set the theme for syntax highlighting. Use '--list-themes' to \
|
||||
see all available themes. To set a default theme, add the \
|
||||
'--theme=\"...\"' option to the configuration file or export the \
|
||||
BAT_THEME environment variable (e.g.: export \
|
||||
BAT_THEME=\"...\").",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("list-themes")
|
||||
.long("list-themes")
|
||||
.help("Display all supported highlighting themes.")
|
||||
.long_help("Display a list of supported themes for syntax highlighting."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("style")
|
||||
.long("style")
|
||||
.value_name("style-components")
|
||||
// Need to turn this off for overrides_with to work as we want. See the bottom most
|
||||
// example at https://docs.rs/clap/2.32.0/clap/struct.Arg.html#method.overrides_with
|
||||
.use_delimiter(false)
|
||||
.takes_value(true)
|
||||
.overrides_with("style")
|
||||
.overrides_with("plain")
|
||||
.overrides_with("number")
|
||||
// Cannot use clap's built in validation because we have to turn off clap's delimiters
|
||||
.validator(|val| {
|
||||
let mut invalid_vals = val.split(',').filter(|style| {
|
||||
!&[
|
||||
"auto", "full", "plain", "changes", "header", "grid", "numbers", "snip"
|
||||
]
|
||||
.contains(style)
|
||||
});
|
||||
|
||||
if let Some(invalid) = invalid_vals.next() {
|
||||
Err(format!("Unknown style, '{}'", invalid))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
})
|
||||
.help(
|
||||
"Comma-separated list of style elements to display \
|
||||
(*auto*, full, plain, changes, header, grid, numbers, snip).",
|
||||
)
|
||||
.long_help(
|
||||
"Configure which elements (line numbers, file headers, grid \
|
||||
borders, Git modifications, ..) to display in addition to the \
|
||||
file contents. The argument is a comma-separated list of \
|
||||
components to display (e.g. 'numbers,changes,grid') or a \
|
||||
pre-defined style ('full'). To set a default style, add the \
|
||||
'--style=\"..\"' option to the configuration file or export the \
|
||||
BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\"). \
|
||||
Possible values: *auto*, full, plain, changes, header, grid, numbers, snip.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("plain")
|
||||
.overrides_with("plain")
|
||||
.overrides_with("number")
|
||||
.short("p")
|
||||
.long("plain")
|
||||
.multiple(true)
|
||||
.help("Show plain style (alias for '--style=plain').")
|
||||
.long_help(
|
||||
"Only show plain style, no decorations. This is an alias for \
|
||||
'--style=plain'. When '-p' is used twice ('-pp'), it also disables \
|
||||
automatic paging (alias for '--style=plain --pager=never').",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("number")
|
||||
.long("number")
|
||||
.overrides_with("number")
|
||||
.short("n")
|
||||
.help("Show line numbers (alias for '--style=numbers').")
|
||||
.long_help(
|
||||
"Only show line numbers, no other decorations. This is an alias for \
|
||||
'--style=numbers'",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("show-all")
|
||||
.long("show-all")
|
||||
.alias("show-nonprintable")
|
||||
.short("A")
|
||||
.conflicts_with("language")
|
||||
.help("Show non-printable characters (space, tab, newline, ..).")
|
||||
.long_help(
|
||||
"Show non-printable characters like space, tab or newline. \
|
||||
This option can also be used to print binary files. \
|
||||
Use '--tabs' to control the width of the tab-placeholders."
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("line-range")
|
||||
.long("line-range")
|
||||
.short("r")
|
||||
.multiple(true)
|
||||
.takes_value(true)
|
||||
.number_of_values(1)
|
||||
.value_name("N:M")
|
||||
.help("Only print the lines from N to M.")
|
||||
.long_help(
|
||||
"Only print the specified range of lines for each file. \
|
||||
For example:\n \
|
||||
'--line-range 30:40' prints lines 30 to 40\n \
|
||||
'--line-range :40' prints lines 1 to 40\n \
|
||||
'--line-range 40:' prints lines 40 to the end of the file",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("highlight-line")
|
||||
.long("highlight-line")
|
||||
.short("H")
|
||||
.takes_value(true)
|
||||
.number_of_values(1)
|
||||
.multiple(true)
|
||||
.value_name("N")
|
||||
.help("Highlight the given line.")
|
||||
.long_help(
|
||||
"Highlight the N-th line with a different background color",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("color")
|
||||
.long("color")
|
||||
.overrides_with("color")
|
||||
.takes_value(true)
|
||||
.value_name("when")
|
||||
.possible_values(&["auto", "never", "always"])
|
||||
.hide_default_value(true)
|
||||
.default_value("auto")
|
||||
.help("When to use colors (*auto*, never, always).")
|
||||
.long_help(
|
||||
"Specify when to use colored output. The automatic mode \
|
||||
only enables colors if an interactive terminal is detected. \
|
||||
Possible values: *auto*, never, always.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("italic-text")
|
||||
.long("italic-text")
|
||||
.takes_value(true)
|
||||
.value_name("when")
|
||||
.possible_values(&["always", "never"])
|
||||
.default_value("never")
|
||||
.hide_default_value(true)
|
||||
.help("Use italics in output (always, *never*)")
|
||||
.long_help("Specify when to use ANSI sequences for italic text in the output. Possible values: always, *never*."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("decorations")
|
||||
.long("decorations")
|
||||
.overrides_with("decorations")
|
||||
.takes_value(true)
|
||||
.value_name("when")
|
||||
.possible_values(&["auto", "never", "always"])
|
||||
.default_value("auto")
|
||||
.hide_default_value(true)
|
||||
.help("When to show the decorations (*auto*, never, always).")
|
||||
.long_help(
|
||||
"Specify when to use the decorations that have been specified \
|
||||
via '--style'. The automatic mode only enables decorations if \
|
||||
an interactive terminal is detected. Possible values: *auto*, never, always.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("paging")
|
||||
.long("paging")
|
||||
.overrides_with("paging")
|
||||
.takes_value(true)
|
||||
.value_name("when")
|
||||
.possible_values(&["auto", "never", "always"])
|
||||
.default_value("auto")
|
||||
.hide_default_value(true)
|
||||
.help("Specify when to use the pager (*auto*, never, always).")
|
||||
.long_help(
|
||||
"Specify when to use the pager. To control which pager \
|
||||
is used, set the PAGER or BAT_PAGER environment \
|
||||
variables (the latter takes precedence) or use the '--pager' option. \
|
||||
To disable the pager permanently, set BAT_PAGER to an empty string \
|
||||
or set '--paging=never' in the configuration file. \
|
||||
Possible values: *auto*, never, always.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("pager")
|
||||
.long("pager")
|
||||
.overrides_with("pager")
|
||||
.takes_value(true)
|
||||
.value_name("command")
|
||||
.hidden_short_help(true)
|
||||
.help("Determine which pager to use.")
|
||||
.long_help(
|
||||
"Determine which pager is used. This option will overwrite \
|
||||
the PAGER and BAT_PAGER environment variables. The default \
|
||||
pager is 'less'. To disable the pager completely, use the \
|
||||
'--paging' option. \
|
||||
Example: '--pager \"less -RF\"'.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("wrap")
|
||||
.long("wrap")
|
||||
.overrides_with("wrap")
|
||||
.takes_value(true)
|
||||
.value_name("mode")
|
||||
.possible_values(&["auto", "never", "character"])
|
||||
.default_value("auto")
|
||||
.hide_default_value(true)
|
||||
.help("Specify the text-wrapping mode (*auto*, never, character).")
|
||||
.long_help("Specify the text-wrapping mode (*auto*, never, character). \
|
||||
The '--terminal-width' option can be used in addition to \
|
||||
control the output width."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("tabs")
|
||||
.long("tabs")
|
||||
.overrides_with("tabs")
|
||||
.takes_value(true)
|
||||
.value_name("T")
|
||||
.validator(
|
||||
|t| {
|
||||
t.parse::<u32>()
|
||||
.map_err(|_t| "must be a number")
|
||||
.map(|_t| ()) // Convert to Result<(), &str>
|
||||
.map_err(|e| e.to_string())
|
||||
}, // Convert to Result<(), String>
|
||||
)
|
||||
.help("Set the tab width to T spaces.")
|
||||
.long_help(
|
||||
"Set the tab width to T spaces. Use a width of 0 to pass tabs through \
|
||||
directly",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("unbuffered")
|
||||
.short("u")
|
||||
.long("unbuffered")
|
||||
.hidden_short_help(true)
|
||||
.long_help(
|
||||
"This option exists for POSIX-compliance reasons ('u' is for \
|
||||
'unbuffered'). The output is always unbuffered - this option \
|
||||
is simply ignored.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("terminal-width")
|
||||
.long("terminal-width")
|
||||
.takes_value(true)
|
||||
.value_name("width")
|
||||
.hidden_short_help(true)
|
||||
.allow_hyphen_values(true)
|
||||
.validator(
|
||||
|t| {
|
||||
let is_offset = t.starts_with('+') || t.starts_with('-');
|
||||
t.parse::<i32>()
|
||||
.map_err(|_e| "must be an offset or number")
|
||||
.and_then(|v| if v == 0 && !is_offset {
|
||||
Err("terminal width cannot be zero".into())
|
||||
} else {
|
||||
Ok(())
|
||||
})
|
||||
.map_err(|e| e.to_string())
|
||||
})
|
||||
.help(
|
||||
"Explicitly set the width of the terminal instead of determining it \
|
||||
automatically. If prefixed with '+' or '-', the value will be treated \
|
||||
as an offset to the actual terminal width. See also: '--wrap'.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("no-config")
|
||||
.long("no-config")
|
||||
.hidden(true)
|
||||
.help("Do not use the configuration file"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("config-file")
|
||||
.long("config-file")
|
||||
.conflicts_with("list-languages")
|
||||
.conflicts_with("list-themes")
|
||||
.hidden(true)
|
||||
.help("Show path to the configuration file."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("config-dir")
|
||||
.long("config-dir")
|
||||
.hidden(true)
|
||||
.help("Show bat's configuration directory."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("cache-dir")
|
||||
.long("cache-dir")
|
||||
.hidden(true)
|
||||
.help("Show bat's cache directory."),
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("cache")
|
||||
.about("Modify the syntax-definition and theme cache")
|
||||
.arg(
|
||||
Arg::with_name("build")
|
||||
.long("build")
|
||||
.short("b")
|
||||
.help("Initialize (or update) the syntax/theme cache.")
|
||||
.long_help(
|
||||
"Initialize (or update) the syntax/theme cache by loading from \
|
||||
the source directory (default: the configuration directory).",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("clear")
|
||||
.long("clear")
|
||||
.short("c")
|
||||
.help("Remove the cached syntax definitions and themes."),
|
||||
)
|
||||
.group(
|
||||
ArgGroup::with_name("cache-actions")
|
||||
.args(&["build", "clear"])
|
||||
.required(arg_group_required),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("source")
|
||||
.long("source")
|
||||
.requires("build")
|
||||
.takes_value(true)
|
||||
.value_name("dir")
|
||||
.help("Use a different directory to load syntaxes and themes from."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("target")
|
||||
.long("target")
|
||||
.requires("build")
|
||||
.takes_value(true)
|
||||
.value_name("dir")
|
||||
.help(
|
||||
"Use a different directory to store the cached syntax and theme set.",
|
||||
),
|
||||
)
|
||||
.arg(Arg::with_name("blank").long("blank").requires("build").help(
|
||||
"Create completely new syntax and theme sets \
|
||||
(instead of appending to the default sets).",
|
||||
)),
|
||||
)
|
||||
.help_message("Print this help message.")
|
||||
.version_message("Show version information.")
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user