vim-chip8 : Syntax highlighting and indentation rules for Chip8 assembly.
| script karma
Downloaded by 581
Comments, bugs, improvements
script versions (upload new version)
|Syntax highlighting and indentation rules for Chip8 assembly. These rules will apply to any *.8o file.
Full support for the SuperChip and XO-Chip instruction sets is available, but not enabled out-of-the-box. Read below for directions.
conditionals: begin, else, end, if, then, while
constants: buzzer, const, delay, key
functions: bcd, jump, jump0, load, save, sprite
repeats: again, loop
statements: :alias`, :breakpoint, :next, :unpack, clear, return
There is also syntax highlighting for named subroutines, integer/hex/binary values, and comments.
Auto-indentation will trigger for the following cases
* indent one shiftwidth on lines following `loop`
* indent one shiftwidth on lines following `while`
* unindent to matching `loop` when ending it with `again`
* indent one shiftwidth on lines following `if ... begin` and `else`
* unindent to matching `if ... begin` when ending it with `end`
* indent to zero for new labels
* indent one shiftwidth on lines following new labels
* indent to zero when ending a subroutine with `;`
An expanded set of keywords are supported for the SuperChip instruction set. To enable these uncomment out the following line in syntax/8o.vim:
"let b:superChip = 1
functions: hires, loadflags, lores, saveflags, scroll-down, scroll-left, scroll-right
Another set of keywords are available to support the XO-Chip instructions. These are also disabled by default but can be turned on by uncommenting out the following line in syntax/8o.vim:
"let b:superChip = 1
functions: plane, scroll-up
I really haven't done a whole lot of Chip8 programming so if something feels weird or is missing, please feel free to leave an issue of submit a pull request at https://github.com/jackiekircher/vim-chip8
|Copy the corresponding files to your vim directory (~/.vim/ or ~/vimfiles/):
ftdetect/8o.vim to ~/.vim/ftdetect/8o.vim
syntax/8o.vim to ~/.vim/syntax/8o.vim
indent/8o.vim to ~/.vim/indent/8o.vim
Click on the package to download.
ip used for rating: 184.108.40.206
||* add support for the XO-Chip
* increase hex number length to 4 digits
* add highlighting and indentation support for 'if ... begin' blocks
* support nesting auto-indentation with loops and if statements
* fix highlighting rules for 'scroll-down', 'scroll-left', and 'scroll-right'
* include function highlighting for main chip8 functions by default
* don't auto-indent labels until typing a space after ':'