Vim Syntax Highlighting

From ABL
Revision as of 13:03, 26 March 2007 by Kane (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Copy the below file into a file called abl.vim in your syntax folder (usually in $VIM/syntax or $VIM/vim70/syntax)

Editing your filetype.vim file (usually in $VIM) to include "au BufNewFile,BufRead *.abl setf abl"

Yay syntax highlighting!

"Vim syntax file
" Language: 	ABL

" Quit when a syntax file was already loaded
if !exists("main_syntax")
  if version < 600
    syntax clear
  elseif exists("b:current_syntax")
  " we define it here so that included files can test for it
  let main_syntax='java'

"only use vim > 6.0
command! -nargs=+ AblHiLink hi def link <args>

syn keyword ablBehavior		behavior parallel sequential joint
syn keyword ablBoolean		true false
syn keyword ablGoal			subgoal
syn keyword ablAct			act
syn keyword ablPre			precondition
syn keyword ablRegistration	register wme
syn keyword ablWith			with
syn keyword ablPackage		package
syn keyword ablImport		import
syn keyword ablType			boolean int float char long short double
syn keyword ablTest			success_test wait
syn keyword ablStep			success_step fail_step
syn keyword ablMental		mental_act

syn region ablComment		start="/\*" end="\*/"
syn match ablLineComment	"//.*"

AblHiLink ablBehavior		Function
AblHiLink ablBoolean		Boolean
AblHiLink ablGoal 			Function
AblHiLink ablAct			Function
AblHiLink ablPre			Special
AblHiLink ablRegistration	Special
AblHiLink ablWith			Conditional
AblHiLink ablPackage		Special
AblHiLink ablImport			Special
AblHiLink ablType			Type
AblHiLink ablTest			Conditional
AblHiLink ablStep			Statement
AblHiLink ablMental			Special
AblHiLink ablComment		Comment
AblHiLink ablLineComment	Comment

delcommand AblHiLink

let b:current_syntax = "abl"