Skip to content

Instantly share code, notes, and snippets.

@cheery
Created December 9, 2018 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheery/2a34769a2398a345ad77235e8d1c3693 to your computer and use it in GitHub Desktop.
Save cheery/2a34769a2398a345ad77235e8d1c3693 to your computer and use it in GitHub Desktop.
a minimal 'binary' markup language
 + title  Markup-file under vim editing 
Text can still remain mostly plain text
with suitable adjustments,
even if the some of the characters
between pre]0x00 - 0x20[ range was
re-purposed for different use.
The pathwp.vim -script is a demonstration piece
and not intended for practical use.
I wish people would spend some time cultivating the idea
before bringing it down into the practice.
Suitability for rich-text editing should be checked
before making use of this format.
A fine environment may require more support than
what is already present in the current description.
To try the code, run this script with
pre:so wp.vim -command,
over the pathmarkup.wp -file.
" This trick uses concealing in vim editor
" to represent few control characters for formatting.
set conceallevel=1
set concealcursor=ni
" The character set used here doesn't correspond to the
" character set in the lobte.rs post.
syntax match Conceal // conceal cchar=$ "SH
syntax match Conceal // conceal cchar=¤ "SX
syntax match Conceal // conceal cchar=[ "EX
syntax match Conceal // conceal cchar=] "ET
syntax match Conceal // conceal cchar=: "EQ
syntax match Conceal // conceal cchar=` "AK
syntax match Conceal // conceal cchar={ "BL
syntax match Conceal // conceal cchar=} "BS
hi! link Conceal Special
" Ctrl+space is used to control insertion.
" It starts with program/text modes abbreviated 'p', 't'
inoremap <C-Space>p <C-k>SH
inoremap <C-Space>t <C-k>SX
" To add :___: -'header'.
inoremap <C-space>i <C-k>EQ<C-k>EQ<Left>
" The 's' is there for creating a structure.
inoremap <C-Space>s <C-k>EX<C-k>EQ<C-k>ET<Left><Left>
" 'q' for quotes
inoremap <C-Space>q <C-k>AK<C-k>AK<Left>
" 'h' for 'hole'
inoremap <C-Space>h <C-k>BL<C-k>BS<Left>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment