Archive for June, 2012

UCF Filetype for Geany

Saturday, June 30th, 2012

Geany is currently my favorite graphical editor. Soon, I was missing a syntax highlighting for UCF (user constraints file) files and recently I was motivated to create an UCF Filetype.

I built it according to the information in the Geany Manual, and here it is (sorry for the horrible formatting, but some stuff has to be in one single line):

# For complete documentation of this file, please see Geany's main documentation [styling] 
# foreground;background;bold;italic 
default=default 
comment=comment 
number=number 
word=keyword 
word2=keyword2 
string=string 
preprocessor=preprocessor
 
[keywords] # all items must be in one line 
primary=AREA_GROUP ASYNC_REG BEL BLKNM BUFG COLLAPSE COMPGRP CONFIG CONFIG_MODE COOL_CLK DATA_GATE DCI_VALUE DISABLE DROP_SPEC ENABLE FEEDBACK FILE FLOAT FROM HBLKNM HU_SET IN INREG IOB IOBDELAY IOSTANDARD KEEP KEEP_HIERARCHY KEEPER LOC LOCATE LOCK_PIN MAP MAXDELAY MAXPT MAXSKEW NET NODELAY NOREDUCE OFFSET OPEN_DREIN OPT_EFFORT OPTIMIZE OUT PERIOD PIN PRIORITY PROHIBIT PWR_MODE REG RLOC RLOC_ORIGIN RLOC_RANGE SCHMITT_TRIGGER SLEW SYSTEM_JITTER TEMPERATURE THRU TIG TIMEGRP TIMESPEC TNM TO TPSYNC TPTHRU U_SET USE_RLOC USELOWSKEWLINES VFEF VOLTAGE WIREAND XBLKNM 
secondary=COMPRESSION DATAPATHONLY GROUP IMPLEMENT INST MODE PLACE RANGE ROUTE TNM_NET AFTER BEFORE DRIVE FALLING FAST HIGH NOT PULLDOWN PULLUP RISING SLOW 
#docComment=
 
[settings] 
# Vala uses the C lexer
lexer_filetype=C
tag_parser=Python
 
# default extension used when saving files
extension=ucf
 
# the following characters are these which a "word" can contains, see documentation 
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
# if only single comment char is supported like 
# in this file, leave comment_close blank 
comment_single=#

Create the file ~/.config/geany/filedefs/filetypes.ucf.conf and insert the text above.

Then open Geany and insert the following line to filetypes_extensions.conf (Tools -> Configuration Files)

ucf=*.ucf;

Now, Geany should do some basic but useful syntax highlighting for ucf files!