在Visual Studio中为其他语言添加着色

想在Visual Studio 2008中编辑PHP文件, 可以这样添加着色, 使得PHP关键字高亮显示.

效果:

php.jpg

1. 注册表操作

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\FileExtensions下添加一个键, 名字为”.php”, 值为”{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}”

2. 添加文件

在C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE下添加一个名为”usertype.dat”的文件, 内容为:

and
or
xor
__FILE__
exception
__LINE__
array
as
break
case
class
const
continue
declare
default
die
do
echo
else
elseif
empty
enddeclare
endfor
endforeach
endif
endswitch
endwhile
eval
exit
extends
for
foreach
function
global
if
include
include_once
isset
list
new
print
require
require_once
return
static
switch
unset
use
var
while
__FUNCTION__
__CLASS__
__METHOD__
final
php_user_filter
interface
implements
extends
public
private
protected
abstract
clone
try
catch
throw
cfunction
old_function
this

Leave a Reply

Your email address will not be published. Required fields are marked *