sponsor Vim development Vim logo Vim Book Ad

redcode.vim : Redcode '88 '94 and Pspace syntax for Corewars

 script karma  Rating 27/9, Downloaded by 636    Comments, bugs, improvements  Vim wiki

created by
Philip Thorne
script type
This syntax file supports the REDCODE '88 or '94 (with or without Pspace extensions) languages as defined in the ICWS'94 Draft (extended).


The language was first popularized in a March 1984 Scientific American article, Core War Guidelines, by A. K. Dewdney and D. G. Jones.

This implementation can be configured to flag elements of Redcode '94 when used in coding Redcode '88 warriors. It also highlights line-continuations (responsible for a well-known problem with the program Marcia Trionfale 1.3).

install details
These instructions assume a linux|unix type system. Similar steps apply for MS Windows users.

To use the syntax file copy it into the directory ~/.vim/syntax (create the direcory path if not already present).

Create a file named red.vim in ~/.vim/ftdetect (again creating the directory if not already present).
This file defines .red as the filetype of REDCODE source files. It should contain:

                augroup filetypedetect
                au BufRead,BufNewFile *.red setf redcode
                augroup END

The following options can be used in your .vimrc initialization file to control the degree of syntax checking:
They are all commented out by default.

                "Remove quote characters on subsequent lines to enable options

                "let redcode_88_only = 1
                "let redcode_94_only = 1
                "let redcode_highlight_numbers=1

The default behaviour is to accept '88 '94 and Pspace syntax and to not highlight numbers.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
redcode.vim 1.0 2006-11-06 6.0 Philip Thorne Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo