Skip to content

Instantly share code, notes, and snippets.

@johncant
Last active December 15, 2015 08:09
Show Gist options
  • Save johncant/5228822 to your computer and use it in GitHub Desktop.
Save johncant/5228822 to your computer and use it in GitHub Desktop.
Syntax highlighting for KSP's ProgCom plugin
" Add this to your ~/.vimrc
autocmd BufRead,BufNewFile */PluginData/ProgCom/* set filetype=KSPProgComASM
" Language: ProgCom ASM
" Maintainer: John Cant
" Last Change: Mar 23 2013
" Version: 1
" Put this file in ~/.vim/syntax/
" Create the directory structure if it doesn't already exist
if exists("b:current_syntax")
finish
endif
setlocal iskeyword+=:
syn case ignore
syn match KSPProgComASMComment ";.*"
syn keyword KSPProgComASMInstruction add
syn keyword KSPProgComASMInstruction addi
syn keyword KSPProgComASMInstruction sub
syn keyword KSPProgComASMInstruction subi
syn keyword KSPProgComASMInstruction mul
syn keyword KSPProgComASMInstruction muli
syn keyword KSPProgComASMInstruction div
syn keyword KSPProgComASMInstruction divi
syn keyword KSPProgComASMInstruction Mov
syn keyword KSPProgComASMInstruction Movi
syn keyword KSPProgComASMInstruction Movil
syn keyword KSPProgComASMInstruction Movhi
syn keyword KSPProgComASMInstruction shl
syn keyword KSPProgComASMInstruction sli
syn keyword KSPProgComASMInstruction shr
syn keyword KSPProgComASMInstruction sri
syn keyword KSPProgComASMInstruction and
syn keyword KSPProgComASMInstruction or
syn keyword KSPProgComASMInstruction xor
syn keyword KSPProgComASMInstruction not
syn keyword KSPProgComASMInstruction jmp
syn keyword KSPProgComASMInstruction jmpr
syn keyword KSPProgComASMInstruction jmpeq
syn keyword KSPProgComASMInstruction jmpeqr
syn keyword KSPProgComASMInstruction jmpeqri
syn keyword KSPProgComASMInstruction jmpif
syn keyword KSPProgComASMInstruction jmpifr
syn keyword KSPProgComASMInstruction jmpne
syn keyword KSPProgComASMInstruction jmpnr
syn keyword KSPProgComASMInstruction jmpl
syn keyword KSPProgComASMInstruction jmplri
syn keyword KSPProgComASMInstruction call
syn keyword KSPProgComASMInstruction callr
syn keyword KSPProgComASMInstruction loop
syn keyword KSPProgComASMInstruction rd
syn keyword KSPProgComASMInstruction wr
syn keyword KSPProgComASMInstruction push
syn keyword KSPProgComASMInstruction pop
syn keyword KSPProgComASMInstruction halt
syn keyword KSPProgComASMInstruction nop
syn keyword KSPProgComASMInstruction float
syn keyword KSPProgComASMInstruction flcmp
syn keyword KSPProgComASMInstruction int
syn keyword KSPProgComASMInstruction eret
syn keyword KSPProgComASMInstruction gepc
syn keyword KSPProgComASMInstruction fpush
syn keyword KSPProgComASMInstruction fpush0
syn keyword KSPProgComASMInstruction fpush1
syn keyword KSPProgComASMInstruction fpushn1
syn keyword KSPProgComASMInstruction fpushpi
syn keyword KSPProgComASMInstruction fpop
syn keyword KSPProgComASMInstruction fadd
syn keyword KSPProgComASMInstruction fsub
syn keyword KSPProgComASMInstruction fmul
syn keyword KSPProgComASMInstruction fdiv
syn keyword KSPProgComASMInstruction fsel0
syn keyword KSPProgComASMInstruction fsel1
syn keyword KSPProgComASMInstruction fmerge
syn keyword KSPProgComASMInstruction ftof
syn keyword KSPProgComASMInstruction ftoi
syn keyword KSPProgComASMInstruction fflush
syn keyword KSPProgComASMConstant GLOBAL_MAINTHROTTLE
syn keyword KSPProgComASMConstant GLOBAL_YAW
syn keyword KSPProgComASMConstant GLOBAL_PITCH
syn keyword KSPProgComASMConstant GLOBAL_ROLL
syn keyword KSPProgComASMConstant GLOBAL_SURFACE_EAST
syn keyword KSPProgComASMConstant GLOBAL_SURFACE_UP
syn keyword KSPProgComASMConstant GLOBAL_SURFACE_NORTH
syn keyword KSPProgComASMConstant GLOBAL_VESSEL_X
syn keyword KSPProgComASMConstant GLOBAL_VESSEL_Y
syn keyword KSPProgComASMConstant GLOBAL_VESSEL_HEADING
syn keyword KSPProgComASMConstant GLOBAL_VESSEL_Z
syn keyword KSPProgComASMConstant GLOBAL_ORBITSPEED
syn keyword KSPProgComASMConstant GLOBAL_SURFACESPEED
syn keyword KSPProgComASMConstant GLOBAL_ANGULARVELOCITY
syn keyword KSPProgComASMConstant GLOBAL_ALTITUDE
syn keyword KSPProgComASMConstant GLOBAL_NUMPAD_OUT
syn keyword KSPProgComASMConstant GLOBAL_NUMPAD_MSG
syn keyword KSPProgComASMConstant GLOBAL_NUMPAD_IN
syn keyword KSPProgComASMConstant GLOBAL_NUMPAD_NEWIN
syn keyword KSPProgComASMConstant GLOBAL_NUMPAD_FORMAT
syn keyword KSPProgComASMConstant GLOBAL_TIMER
syn keyword KSPProgComASMConstant GLOBAL_VECTORACCURACY
syn keyword KSPProgComASMConstant GLOBAL_IENABLE
syn keyword KSPProgComASMConstant GLOBAL_CLOCK
syn keyword KSPProgComASMConstant GLOBAL_IADRESS
syn keyword KSPProgComASMConstant GLOBAL_TIMER_MAX
syn keyword KSPProgComASMConstant GLOBAL_PILOT_THROTTLE
syn keyword KSPProgComASMConstant GLOBAL_PILOT_YAW
syn keyword KSPProgComASMConstant GLOBAL_PILOT_PITCH
syn keyword KSPProgComASMConstant GLOBAL_PILOT_ROLL
syn keyword KSPProgComASMConstant GLOBAL_PILOT_RCS_RIGHT
syn keyword KSPProgComASMConstant GLOBAL_PILOT_RCS_UP
syn keyword KSPProgComASMConstant GLOBAL_PILOT_RCS_FORWARD
syn keyword KSPProgComASMConstant GLOBAL_RCS_RIGHT
syn keyword KSPProgComASMConstant GLOBAL_RCS_UP
syn keyword KSPProgComASMConstant GLOBAL_RCS_FORWARD
syn keyword KSPProgComASMConstant GLOBAL_ACTIONGROUP
syn match KSPProgComASMPreprocessorInclude "#include"
syn match KSPProgComASMPreprocessor "#allocate"
syn match KSPProgComASMInteger "\<[0-9]*\>"
highlight link KSPProgComASMComment Comment
highlight link KSPProgComASMInstruction Keyword
highlight link KSPProgComASMConstant Constant
highlight link KSPProgComASMInteger Number
highlight link KSPProgComASMPreprocessorInclude Include
highlight link KSPProgComASMPreprocessor Macro
let b:current_syntax = "KSPProgComASM"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment