vim/gen_conceal.awk

29 lines
474 B
Awk
Raw Normal View History

2022-07-17 14:08:06 -07:00
#!/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
}