Added conceal generator

master
Mark 2022-07-17 14:08:06 -07:00
parent 278fbf44fb
commit 9024799d0f
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
4 changed files with 166 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.netrwhist .netrwhist
conceal.vim

131
conceal_defs Normal file
View File

@ -0,0 +1,131 @@
# Define strings to conceal here.
# Format is `char | string`, where
# `char` is the character that will replace `string`.
#
# `char` MUST be a SINGLE character.
# All whitespace is ignored.
#
# To generate vim file, do `./gen_conceal.awk this_file`
# Greek letters
Α | Alpha
α | alpha
Β | Beta
β | beta
Γ | Gamma
γ | gamma
Δ | Delta
δ | delta
Ε | Epsilon
ε | epsilon
Ζ | Zeta
ζ | zeta
Η | Eta
η | eta
Θ | Theta
θ | theta
Ι | Iota
ι | iota
Κ | Kappa
κ | kapa
Λ | Lambda
λ | lambda
Μ | Mu
μ | mu
Ν | Nu
ν | nu
Ξ | Xi
ξ | xi
Ο | Omicron
ο | omicron
Π | Pi
π | pi
Ρ | Rho
ρ | rho
Σ | Sigma
σ | sigma
Τ | Tau
τ | tau
Υ | Upsilon
υ | upsilon
Φ | Phi
φ | phi
Χ | Xi
χ | xi
Ψ | Psi
ψ | psi
Ω | Omega
ω | omega
# Blackboard Bold
𝔸 | _bbA
𝕒 | _bba
𝔹 | _bbB
𝕓 | _bbb
| _bbC
𝕔 | _bbc
𝔻 | _bbD
𝕕 | _bbd
𝔼 | _bbE
𝕖 | _bbe
𝔽 | _bbF
𝕗 | _bbf
𝔾 | _bbG
𝕘 | _bbg
| _bbH
𝕙 | _bbh
𝕀 | _bbI
𝕚 | _bbi
𝕁 | _bbJ
𝕛 | _bbj
𝕂 | _bbK
𝕜 | _bbk
𝕃 | _bbL
𝕝 | _bbl
𝕄 | _bbM
𝕞 | _bbm
| _bbN
𝕟 | _bbn
𝕆 | _bbO
𝕠 | _bbo
| _bbP
𝕡 | _bbp
| _bbQ
𝕢 | _bbq
| _bbR
𝕣 | _bbr
𝕊 | _bbS
𝕤 | _bbs
𝕋 | _bbT
𝕥 | _bbt
𝕌 | _bbU
𝕦 | _bbu
𝕍 | _bbV
𝕧 | _bbv
𝕎 | _bbW
𝕨 | _bbw
𝕏 | _bbX
𝕩 | _bbx
𝕐 | _bbY
𝕪 | _bby
| _bbZ
𝕫 | _bbz
𝟘 | _bb0
𝟙 | _bb1
𝟚 | _bb2
𝟛 | _bb3
𝟜 | _bb4
𝟝 | _bb5
𝟞 | _bb6
𝟟 | _bb7
𝟠 | _bb8
𝟡 | _bb9
# Math symbols
∈ | _in
∉ | _notin
∀ | _forall
∃ | _exists
⇒ | _implies
⇔ | _iff
∞ | _inf

28
gen_conceal.awk Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/awk -f
BEGIN {
c = "\""
print c " Conceal character file generated by awk."
print c " Do not edit this manually."
}
{
# Ignore all whitespace
gsub("\\s", "", $0)
# Skip comments
if (substr($0,0,1) == "#") { next }
# Skip blank lines
if (NF <= 0) { next }
# Extract args
p = index($0, "|")
conceal = substr($0,0,p-1)
keyword = substr($0,p+1)
# Vim config output
print ":syntax match keyword \"\\<" keyword "\\>\" conceal cchar=" conceal
}

6
vimrc
View File

@ -259,3 +259,9 @@ augroup pencil
autocmd FileType text call pencil#init() autocmd FileType text call pencil#init()
autocmd FileType text setlocal list autocmd FileType text setlocal list
augroup END augroup END
" Configure and load conceal chars
:set conceallevel=2
highlight Conceal ctermbg=NONE ctermfg=green guibg=NONE guifg=NONE
source ~/.vim/conceal.vim