From 79bcb4dcb4cbb2c2ce5fe09db1f7a523b1f3451b Mon Sep 17 00:00:00 2001 From: - <@> Date: Wed, 5 Aug 2020 23:36:45 +0300 Subject: Vim status line --- editors/vim/autoload/bqn.txt | 40 ++++++++++++++++++++++++++++++++++++++++ editors/vim/autoload/bqn.vim | 11 +++++++++++ editors/vim/ftplugin/bqn.vim | 2 ++ 3 files changed, 53 insertions(+) create mode 100644 editors/vim/autoload/bqn.txt create mode 100644 editors/vim/autoload/bqn.vim diff --git a/editors/vim/autoload/bqn.txt b/editors/vim/autoload/bqn.txt new file mode 100644 index 00000000..258a81ae --- /dev/null +++ b/editors/vim/autoload/bqn.txt @@ -0,0 +1,40 @@ ++ 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* 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(':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 :cal bqn#t() -- cgit v1.2.3