aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-05 17:53:58 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-05 17:53:58 -0400
commita0f7b941f34d9e793bdc0721692881e45bd5833c (patch)
tree668ed7661284a38c607a4169c12468629ab6da5d
parent00c85cd5fcece42a3aedfc177c2456bc7b04dee3 (diff)
parent8ca1c4e5c12af96605f63389a0d988795ba40112 (diff)
Merge branch 'ngn-master'
-rw-r--r--editors/vim/autoload/bqn.txt83
-rw-r--r--editors/vim/autoload/bqn.vim11
-rw-r--r--editors/vim/ftplugin/bqn.vim2
3 files changed, 96 insertions, 0 deletions
diff --git a/editors/vim/autoload/bqn.txt b/editors/vim/autoload/bqn.txt
new file mode 100644
index 00000000..66d6cfce
--- /dev/null
+++ b/editors/vim/autoload/bqn.txt
@@ -0,0 +1,83 @@
+← Define
+↩ Change
+→ Return
+⋄ Separator
+, Separator
+: Header separator
+; Body separator
+( Begin expression
+) End expression
+{ Begin function or modifier
+} End function or modifier
+⟨ Begin list
+⟩ End list
+‿ Strand
+· Nothing
+𝕨 Left argument
+𝕎 Left argument (function)
+𝕩 Right argument
+𝕏 Right argument (function)
+𝕗 Modifier left operand (subject)
+𝔽 Modifier left operand
+𝕘 2-modifier right operand (subject)
+𝔾 2-modifier right operand
+# Comment
++ Conjugate ; Add
+- Negate ; Subtract
+× Sign ; Multiply
+÷ Reciprocal ; Divide
+⋆ Exponential ; Power
+√ Square Root ; Root
+⌊ Floor ; Minimum
+⌈ Ceiling ; Maximum
+∧ Sort Up ; And*
+∨ Sort Down ; Or*
+¬ Not* ; Span*
+| Absolute Value ; Modulus
+≤ ; Less Than or Equal to
+< Enclose ; Less Than
+> Merge ; Greater Than
+≥ ; Greater Than or Equal to
+= Rank ; Equals
+≠ Length ; Not Equals
+≡ Depth* ; Match
+≢ Shape ; Not Match
+⊣ Identity ; Left
+⊢ Identity ; Right
+⥊ Deshape ; Reshape
+∾ Join* ; Join to
+≍ Solo* ; Couple*
+↑ Prefixes* ; Take
+↓ Suffixes* ; Drop
+↕ Range ; Windows*
+⌽ Reverse ; Rotate
+⍉ Transpose* ; Reorder axes*
+/ Indices ; Replicate
+⍋ Grade Up ; Bins Up
+⍒ Grade Down ; Bins Down
+⊏ First Cell* ; Select*
+⊑ First ; Pick*
+⊐ ; Index of
+⊒ Occurrence Count* ; Progressive Index of*
+∊ Unique Mask ; Member of
+⍷ Deduplicate ; Find
+⊔ Group Indices* ; Group*
+! Assert ; Assert with message
+˜ Self/Swap {𝕩𝔽𝕨⊣𝕩}
+∘ Atop {𝔽𝕨𝔾𝕩}
+○ Over {(𝔾𝕨)𝔽𝔾𝕩}
+⊸ Before/Bind {(𝔽𝕨⊣𝕩)𝔾𝕩}
+⟜ After/Bind {(𝕨⊣𝕩)𝔽𝔾𝕩}
+⌾ Under {𝔾⁼∘𝔽○𝔾} OR {(𝔾𝕩)↩𝕨𝔽○𝔾𝕩⋄𝕩}
+⊘ Valences {𝔽𝕩;𝕨𝔾𝕩}
+◶ Choose {f←(𝕨𝔽𝕩)⊑𝕘 ⋄ 𝕨F𝕩}
+˘ Cells
+⎉ Rank
+¨ Each
+⚇ Depth
+⌜ Table
+⁼ Undo
+⍟ Repeat
+´ Fold
+˝ Insert
+` Scan
diff --git a/editors/vim/autoload/bqn.vim b/editors/vim/autoload/bqn.vim
new file mode 100644
index 00000000..b294d93c
--- /dev/null
+++ b/editors/vim/autoload/bqn.vim
@@ -0,0 +1,11 @@
+let s:s=0|let s:f=expand('<sfile>:p:r').'.txt'
+fu bqn#t() "toggle status line
+ if s:s|let[s:s,s:a,&ls,&stl]=[0,[],s:ls,s:stl]|retu|en
+ try|let s:a=readfile(s:f)|let g:sa=s:a|cat|let s:a=[]|endt
+ let[s:s,s:ls,s:stl]=[1,&ls,&stl]
+ let&ls=2|let&stl='%{bqn#l()}'
+endf
+fu bqn#l() "render content of status line
+ let c=substitute(getline('.')[col('.')-1:],'\(\_.\)\_.*','\1','')
+ for x in s:a|if c=~#x[:len(c)-1]|retu x|en|endfo|retu c
+endf
diff --git a/editors/vim/ftplugin/bqn.vim b/editors/vim/ftplugin/bqn.vim
index 41eb3912..fe4ca541 100644
--- a/editors/vim/ftplugin/bqn.vim
+++ b/editors/vim/ftplugin/bqn.vim
@@ -6,3 +6,5 @@ setlocal iskeyword=@,48-57,_,^×,^÷
setlocal ignorecase
setlocal shiftwidth=2 tabstop=2 softtabstop=2
+
+nn<buffer><f1> :cal bqn#t()<cr>