Qbasic colorscheme

Today I saw a screenshot of Kakoune in a terminal using the classic IBM VGA font, and I got a sudden rush of nostlagia for my childhood poking around in QBasic on MS-DOS. So I dug up some screenshots and put together a quick Kakoune colour scheme that approximately matched:

# builtin faces
face global Default white,blue
face global PrimarySelection blue,bright-white+fg
face global SecondarySelection blue,white+fg
face global PrimaryCursor bright-white,bright-blue+fg
face global SecondaryCursor white,bright-blue+fg
face global PrimaryCursorEol bright-white,cyan+fg
face global SecondaryCursorEol white,cyan+fg
face global LineNumbers default,default
face global LineNumberCursor default,default+r

face global MenuForeground white,black
face global MenuBackground black,white
face global MenuInfo cyan
face global Information black,yellow
face global Error black,red
face global StatusLine bright-white,cyan
face global StatusLineMode bright-yellow,default
face global StatusLineInfo black,default
face global StatusLineValue black,default
face global StatusCursor cyan,white
face global Prompt black,default

face global MatchingChar default,default+b
face global Whitespace bright-blue,default+f
face global WrapMarker black,default+f
face global BufferPadding black,default

# For Code
face global value red
face global type yellow
face global variable green
face global module green
face global function cyan
face global string magenta
face global keyword default+b
face global operator yellow
face global attribute green
face global comment cyan
face global documentation comment
face global meta magenta
face global builtin default+b

# For markup
face global title default+b
face global header cyan
face global mono green
face global block magenta
face global link cyan
face global bullet cyan
face global list yellow

7 Likes

I can only approve of this! Though, were there any colours in QBasic? Wasn’t the only syntax “highlighting” making keywords in uppercase?

The QBasic UI was surprisingly colourful - white-on-blue text for each code buffer (as depicted), black-on-grey menus, white-on-cyan and black-on-cyan text on the status bar. It even had colour-coding for different types of buffer - the online help system used white-on-black instead of white-on-blue, and put bright green triangles around each hyperlink.

That said, QBasic didn’t have syntax highlighting within a buffer - as you say, it really only amounted to making keywords uppercase. The color-scheme could be more “legit” if it set more faces to be plain white-on-blue, but I figure Kakoune users would expect some level of colouring to be present, and lexical highlighting (strings and comments) is legitimately useful.

It would be fun to see an even-more-accurate QBasic scheme with plain text and hooks to set special faces for buffers matching \*doc-.*\* though.

It had very, very basic syntax highlighting. It did color comments differently.

I happened to have an MS-DOS VM lying around, so I booted up QBasic. REM and ' didn’t seem to affect the colour of comments, and there were only three configurable faces (in the Kakoune sense):

As a side note, booting up QBasic after all these years, I was pretty impressed: you can just start typing your program, hitting F1 brings up documentation on the keyword or stdlib function under the cursor, you can hit F5 at any time to start running code, or F8 to start single-stepping, the “immediate” window down the bottom there is a REPL… in terms of integration, it’s the anti-Kakoune (everything’s hard-coded, it’s not extensible) but I do wonder how close Kakoune could get, with sufficient effort.

1 Like

It’s even on the Internet Archive:

Thanks for explaining the “Immediate” window, as I kid I never figured out what it was for :smiley:

1 Like

This was originally just a five minute hack I did just for fun, but I made changes in response to feedback and I didn’t want to edit the OP multiple times, so I just stuck it in a Git repo:

1 Like

Coincidentally, this was on HN today: http://www.nicolasbize.com/blog/30-years-later-qbasic-is-still-the-best/

2 Likes

No idea why I remembered it clearly doing comments. Maybe at some point, I was using Borland to edit those files. Hmph. Thanks for the correction @Screwtapello.