" VIM extension for the Oberon programming language " Daniel Hottinger " Licence: GNU GPL " " Move this file to ~/.vim/ftplugin/ " " $Id: oberon.vim,v 1.3 2002/08/20 14:29:01 hotti Exp $ setlocal cinw=FOR,WHILE,REPEAT,BEGIN,CASE,DO,ELSE,ELSIF,TYPE,CONST,VAR,IMPORT,IF,WITH,RECORD,LOOP " setlocal number " setlocal keywordprg=man " use quickfix mode of vim setlocal makeprg=omake.pl\ % setlocal errorformat=%f>%l:%c:%t:%n:%m" setlocal autowrite " smartindent (on/off) setlocal smartindent map ;s1 :setlocal si map ;s0 :setlocal nosi " oberon comments setlocal comments=sr:(*,mb:*,el:*) map ,c mz^i(* $a *)`z map ,C mz^3x$XXx`z "vmap ,c ``>a *) "vmap ,C `<3x`>h3x vmap ,c :s/^/(* /g:'<,'>s/$/ *)/g vmap ,C :s/^[(]\* //g:'<,'>s/ \*[)]$//g " oberon titles map ,t :s/^[ \t]*//O (40a*jI * o 40a*A)k0WW vmap ,t :'<,'>s/^/ * /'(40a*'>o 40a*A)' to remap 'return' map ;sr :iunmap "(* " * c-style comments " *) "map ;xC :imap *) ;sr:iunmap *)o *):setlocal ai;s1A "map ;xc :setlocal noai;xC:imap * "map! (* (* ;s0;xca " ====================================================================== " Special keywords (loops, nested blocks, ...) " ====================================================================== " -while- map ;whr :imap ;sro iab while WHILE DO;s0oEND;;whr;s1k^ea " -repeat- map ;rpr :imap ;;srko iab repeat REPEAT;s0oUNTIL;s1;rprbea " -if- iab if IF THEN;s0oEND;;s1;whr;se;sik^ea map ;si :iab elsif ELSIF THEN;whr< map ;se :iab else ELSE;ue< map ;ue :iab else Z:iunab else:iab elsif Z:iunab elsif " -for- iab for FOR DO;s0oEND;;s1;whrk^ea " -with- iab with WITH DO;s0oEND;;s1;whrk^ea " -case- iab case CASE OF;s0oEND;;s1;whr;sek^ea " -record- iab record RECORD;s0oEND;;s1;whrkA " -procedure- iab proc PROCEDURE;spra map ;spr :imap ;;s0;sr^wyeoBEGINEND ;P;s1ko " -module- iab module MODULE:0r! tmpl oberon/MODULE;smrA map ;smr :imap ;;s0;sr^wywoEND .P;s1O " -from- "iab from FROM IMPORT;sfr^eli "imap ;sfr :imap! a;sr^A " -loop- iab loop LOOP:setlocal nosiAEND;:setlocal sikA " -begin- iab begin BEGIN:setlocal nosiAEND;:setlocal sikA " ====================================================================== " Other keywords " ====================================================================== iab abs ABS iab array ARRAY iab ash ASH iab boolean BOOLEAN iab by BY iab cap CAP iab char CHAR iab chr CHR iab const CONST iab copy COPY iab dec DEC iab div DIV iab do DO iab downto DOWNTO iab else ELSE iab elsif ELSIF iab end END iab entier ENTIER iab excl EXCL iab exit EXIT iab false FALSE iab goto GOTO iab halt HALT iab import IMPORT iab in IN iab inc INC iab incl INCL iab integer INTEGER iab is IS iab label LABEL iab len LEN iab long LONG iab longint LONGINT iab max MAX iab min MIN iab mod MOD iab new NEW iab nil NIL iab odd ODD iab of OF iab or OR iab ord ORD iab pointer POINTER iab procedure PROCEDURE iab real REAL iab return RETURN iab setlocal SET iab short SHORT iab shortint SHORTINT iab size SIZE iab string ARRAY OF CHAR iab then THEN iab to TO iab true TRUE iab type TYPE iab until UNTIL iab var VAR iab xor XOR