Skip to content

Editing Avalon Docs in Vim

I finally finished working on my Jedit modifications for working with Avalon Travel Publishing documents and got to wondering if I couldn't do something similar with Vim, my favorite console text editor. And sure enough, vim's powerful regular expression functionality made hacking up a syntax file relatively easy and a fun intellectual challenge. This is interesting to the union of all Unix hackers who also write for ATP, which is to say, me alone. But it might be useful for vim hackers interested in building their own syntax highlighting files for working with other markup languages.

As for myself, I created a file of keyboard macros for inputting the diacritical codes, such as

imap ,<tab> <\f\f>


to make setting a tab a simple matter of comma-tab. I made an imap ("input map") command for each diacritical code I use, and I can now edit Avalon files from the command prompt, something that sounds unimpressive until the day you learn how to do it, and then never go back. Just for fun, the power of vim syntax highlighting is in the easier reading of the mark up, and clear signals when you've input the wrong code. Check out code 999, which shows up as an error, and note how much easier it is to see what you've bolded and highlighted. A sample is below. If this is interesting, but you prefer something a little more user friendly, check out my Woodnotes Guide to Using Jedit to Code Manuscripts for Avalon Travel Publishing, which should be a little less scary. Otherwise, download my Vim syntax file for Avalon Documents and Macros from this website, and happy hacking.

Sample:

@1:Managua

@3:HISTORY

@$:Nestled in a shifting bed of volcanic debris and ash, pockmarked by crater lakes, and riven with tectonic faults, Managua's very geology speaks of destruction and rebirth. This is a city grown out of rubble and shaped since prehistory by desperation and tragedy. Once a dusty tropical village of fishermen whose ferocity astounded the Spanish <@GI>conquistadores,<@P> in recent history Managua has been broken, burned, and bombed a half-dozen times, suffering just as often at the hands of nature as the hands of humankind. Still it continues to shake off the dust and recreate itself.

<\f\f>Inhabited since 4000 <H>b.c.<P>, the Nahuatl who made Mana-huac ("the big water vessel") their home at about the time of Christ defended themselves against the Spanish so viciously the latter retaliated by razing the city; the land remained abandoned another 300 years. By the mid-1800s it was again a prosperous fishing village while both Le<#151>n and Granada rivaled for political control of the nation. To ease tensions, the Conservatives and Liberals reached a compromise and declared Managua the new capital, in blissful ignorance of the seismic faults that lay beneath it. That mistake became horrifyingly apparent in 1931, when an earthquake of 5.6 on the Richter scale leveled Managua, still a small municipality of 10 square city blocks, and killed over 1,000 people. For five years, Managuans rebuilt their city, only to see it consumed by flames in the Fire of 1936.

<#200> This is not a code but <#231> this is. 200 <#999> but then it was

@3:This is a new section

@$:<#150>.

@3:SAFETY IN THE CITY

@$:Managua is less dangerous than other Central American capitals, but the best way to stay out of trouble is to avoid areas where you'll find it. Rough <@GI>barrios<@P> include Ren<#142>e Schick, Jorg<#142> Dimitrov, La Fuente, San Judas, Villa Venezuela, Batahola, Las Americas, Bello Amanecer, Vida Nueva, Los Pescadores, Domitila Lugo, Santana, and Hialeah. The walk between the hospedajes of Barrio Martha Quezada and the Plaza Inter/Hotel Crowne Royale should be avoided after dark as this neighborhood is increasingly home to braver and braver knife-bearing teenagers. Also, watch yourself in crowds, particularly those of the Mercado Oriental, urban buses, and sporting, music, or political events.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

The author does not allow comments to this entry