今天突然感觉在用UltraEdit编辑aspx的时候没有语法高亮显示黑黑的一团看起来很不爽,于是决定研究一下如何去实现对其它语言的高亮显示的支持。

上网搜索了一下发现原来很简单,通过UltraEdit提供的语法文件就可以实现了。多数常见的文件格式只要上网去下载一个语言文件包就可以了。具体想下载哪种语言方案可以去UltraEdit的官方网站去看一下,有大概四百多个语言方案的:http://www.ultraedit.com/downloads/additional.html#wordfiles。也有一个压缩文件是将所有支持的方案打包在一起供下载的,才1M多大!

将某个语言方案下载后会得到一个文本文件(如sql2000.txt),打开它会看到第一行有"/L20"SQL Server 2000" Nocase Block Comment......"的字样,这里的/L20指的就是它将被设置为UltraEdit的第20种高亮显示语言(在View->Syntax Highlighting)下可以看到已有哪些类型了。可以将该数字改为1-20(因为UltraEdit只一次支持20种)的任何一个数字,只要不和其它的高亮方案冲突即可。之后将里面的所有内容复制到WordFile.txt中(在UltraEdit的安装目录下)已有的高亮方案的最后面,将其保存即可。之后在UltraEdit中从Advanced -> Configuration -> Syntax Highlighting中加载刚刚编辑过的WordFile.txt,重启UltraEdit即可看到加进来的语法高亮方案。
 


让UltraEdit也支持Delphi语法高亮
2004-11-24 15:34:42 (文章类别:注册表)

平时经常用UltraEdit编写修改代码,但UltraEdit本身不支持Delphi的语法高亮,用起来很不爽,于是编写以下脚本使其支持Delphi,请将其添加到UltraEdit安装路径下的 WORDFILE.TXT 文件的结尾即可。


/L8"Dephi" Line Comment = // Block Comment On = { Block Comment Off = } Block Comment On Alt = (* Block Comment Off Alt = *) Escape Char = \ String Chars = ' Nocase File Extensions = PAS DPR DPK DFM COD INC
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"'<> , .?
/Function String = "%[a-zA-Z_]* ^([a-zA-Z_]+^)(*)[~;]"
/Function String 1 = "%[a-zA-Z_]*.^([a-zA-Z_]+^)(*)[~;]"
/Indent Strings = "begin"
/Unindent Strings = "end"
/C1"Keywords"

absolute abstract and array as asm assembler automated
begin break
case cdecl class const constructor contains continue
default delete destructor dispid dispinterface div do downto dynamic
else end except explicit export exports external
far file finalization finally for forward function
goto
if implementation implements in inherited initialization inline interface is
label library
message mod
near nil nodefault not
object of or out overload override
package packed pascal private procedure program property protected public published
raise read readonly record register reintroduce repeat requires resourcestring
safecall set shl shr stdcall stored string
then threadvar to try type
unit until uses
var virtual
while with write writeonly
xor
/C4"Operators"
+
-
*
=
// /
\
:
%
&
>
<
^
!
|
;
,
.
'
"
(
)
$
[
]
@
// #
// $
~