-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File type detection and basic syntax highlighting
- Loading branch information
0 parents
commit 5ea17c2
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# vim-spicy | ||
|
||
Syntax highlighting for BinPAC++/Spicy grammar files (pac2). | ||
See http://www.icir.org/hilti/ for details. | ||
|
||
Currently, the syntax highlighting is very basic. | ||
|
||
## Installation | ||
|
||
Install like any other Vim plugin, for example using vim-plug. | ||
|
||
## License | ||
|
||
Distributed under the same terms as Vim itself, see <code>:help license</code>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
au BufRead,BufNewFile *.pac2 setfiletype spicy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
setlocal commentstring=#\ %s | ||
setlocal tabstop=2 | ||
setlocal softtabstop=2 | ||
setlocal shiftwidth=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
syn keyword spicyTodo contained TODO XXX FIXME NOTE BUG | ||
syn region spicyComment start="#" end="$" | ||
syn keyword spicyImport module import | ||
syn keyword spicyKeyword | ||
\ type | ||
\ export | ||
\ if | ||
\ switch | ||
\ on | ||
\ var | ||
syn keyword spicyStatement print | ||
syn keyword spicyType | ||
\ addr | ||
\ bitfield | ||
\ bool | ||
\ bytes | ||
\ double | ||
\ enum | ||
\ function | ||
\ int | ||
\ uint8 | ||
\ uint16 | ||
\ uint32 | ||
\ uint64 | ||
\ interval | ||
\ iterator | ||
\ list | ||
\ map | ||
\ set | ||
\ sink | ||
\ time | ||
\ tuple | ||
\ unit | ||
\ vector | ||
syn keyword spicyBoolean True False | ||
syn match spicyHexadecimalInt "\<0x\x\+\>" | ||
|
||
" Set highlights | ||
hi def link spicyTodo Todo | ||
hi def link spicyComment Comment | ||
hi def link spicyImport Include | ||
hi def link spicyKeyword Keyword | ||
hi def link spicyType Type | ||
hi def link spicyStatement Statement | ||
hi def link spicyBoolean Boolean | ||
hi def link spicyHexadecimalInt Number |