From 3577aec3617540ac58d3ab41e8fa163f75e859b7 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 30 Jul 2021 22:41:17 -0400 Subject: Move editors README to markdown --- docs/editors/index.html | 33 +++++++++++++++++++++++++++++++++ docs/index.html | 2 +- docs/keymap.html | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 docs/editors/index.html (limited to 'docs') diff --git a/docs/editors/index.html b/docs/editors/index.html new file mode 100644 index 00000000..3240ac0a --- /dev/null +++ b/docs/editors/index.html @@ -0,0 +1,33 @@ + + + + BQN: Editor support + + +

Editor support

+ +

Editor plugins and other tools for allowing BQN input are in this folder. Input is always performed with a backslash \ prefix by default, using the layout shown here. To type an actual backslash, hit the backslash key twice.

+

This bookmarklet enables BQN input in any webpage in your browser.

+

This userscript highlights BQN code on GitHub.

+

For Android, this fork adds APL and BQN to Hacker's Keyboard.

+

The file inputrc can be copied or appended to ~/.inputrc to enable backslash input in bash, BQN with rlwrap, and other software that uses GNU Readline.

+

If you'd like to contribute files for another editor I'd gladly accept them!

+

XKB

+

The file bqn is for configuring XKB on Linux. To use, copy it to /usr/share/X11/xkb/symbols/, then run

+
$ setxkbmap -layout us,bqn -option grp:switch
+
+

replacing us with your ordinary keyboard layout. switch indicates the right alt key and can be replaced with lswitch for left alt or other codes. The setting will go away on shutdown so you will probably want to configure it to run every time you start up. The way to do this depends on your desktop environment. For further discussion, see Wikipedia or the APL Wiki.

+

Another XKB option, if you have a compose key enabled, is to place XCompose (possibly with adjustments) in ~/.XCompose.

+

Vim

+

Copy or symlink all files into the corresponding directories in ~/.vim. Add the following two lines to ~/.vim/filetype.vim:

+
  au! BufRead,BufNewFile *.bqn setf bqn
+  au! BufRead,BufNewFile * if getline(1) =~ '^#!.*bqn$' | setf bqn | endif
+
+

Include syntax on in your .vimrc for syntax highlighting and filetype plugin on for keyboard input.

+

Emacs

+

Add the following two lines to init.el (usually ~/.emacs.d/init.el), replacing the path appropriately.

+
(add-to-list 'load-path "/path/to/BQN/editors/emacs")
+(require 'gnu-apl-mode)
+
+

Kakoune

+

Copy or symlink kak/autoload/filetype/bqn.kak into autoload/filetype in your Kakoune config directory (probably .config/kak/).

diff --git a/docs/index.html b/docs/index.html index 7a23a015..b90a5921 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@

More snippets are programmed into the live demo at the top of the page: hit the arrow at the right of the code window to see them. For longer samples, you can gaze into the abyss that is the self-hosted compiler, or the shallower but wider abyss of the runtime, or take a look at the friendlier markdown processor used to format and highlight documentation files. This repository also has some translations from "A History of APL in 50 Functions".

How do I work with the character set?

-

Right at the beginning, you can use the bar above the online REPL to enter BQN code: hover over a character to see a short description, and click to insert it into the editor. But you'll soon want to skip the clicking and use keyboard input. I type the special characters using a backslash escape, so that, for example, typing \ then z writes (the backslash character itself is not used by BQN). The online REPL supports this method out of the box, and configuration files to enable it in various other places are included with the editor plugins. There's also a bookmarklet you can use to enable BQN input in any webpage in your browser.

+

Right at the beginning, you can use the bar above the online REPL to enter BQN code: hover over a character to see a short description, and click to insert it into the editor. But you'll soon want to skip the clicking and use keyboard input. I type the special characters using a backslash escape, so that, for example, typing \ then z writes (the backslash character itself is not used by BQN). The online REPL supports this method out of the box, and the editor plugins include or link to ways to enable it for editors, browsers, shells, and so on.

The font comparison page shows several fonts that support BQN (including the one used on this site, BQN386). Most other monospace fonts are missing some BQN characters, such as double-struck letters 𝕨, 𝕩 and so on, which will cause these characters to be rendered with a fallback font and possibly have the wrong width or look inconsistent.

Why would I use it?

There are plenty of clean, modern languages out there, and a good number of array languages. I don't think any other language fits both descriptions quite so well as BQN, and I find the combination lets me write powerful and reliable programs quickly. What you find in the language will depend on your background.

diff --git a/docs/keymap.html b/docs/keymap.html index 1e4881db..0597bb52 100644 --- a/docs/keymap.html +++ b/docs/keymap.html @@ -30,4 +30,4 @@ └───────────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────────────┘ Space: -

See also the editor plugins (and other input methods) and primitive documentation.

+

See also the editor plugins (and other input methods) and primitive documentation.

-- cgit v1.2.3