在VS2012中非常简单的语法着色 [英] Very simple syntax colouring in VS2012

查看:157
本文介绍了在VS2012中非常简单的语法着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想在Visual Studio中使用所有漂亮的语法着色编辑SQL,但我不希望它尝试过于聪明,尝试访问数据库等



我认为一种方法可能是创建我自己的文件类型(比如 .sqlt )。如果我什么都不做,这将被简单地视为文本文件,这意味着没有着色。有没有办法让VS给它上色就好像它是 .sql 文件一样?



我看过文章设置为VS中的自定义文件类型着色,无法相信涉及多少工作。在我使用的大多数其他文本编辑器中,您可以轻松创建自定义类型,只需创建配置文件,包含关键字,运算符等。它需要十分钟。为什么VS必须做出这么简单的事情呢?



(注意:我对自动完成/智能感知并不感到烦恼)。





亲切的愿望~Patrick

Hi,

I would like to edit SQL in Visual Studio with all the nice syntax colouring but I don't want it to try being too clever, trying to access the database etc.

I thought one way to do this might be to create my own file type (say .sqlt). If I do nothing, this will simply be treated as a text file, which means no colouring. Is there a way I can get VS to colour it as if it were a .sql file?

I have looked at articles for setting up colouring for custom file types in VS and cannot believe how much work is involved. In most other text editors I have used, you can easily create a custom type just be creating a config file, containing the keywords, operators, etc. It takes ten minutes. Why does VS have to make such a simple thing so damned complicated?

(Note: I am not bothered about auto-completion/Intellisense).


Kind wishes ~ Patrick

推荐答案

请忽略谢尔盖的回答他试图变聪明并且失败。



是的,您可以控制在名为Usertype.dat的用户数据文件中保存的关键字识别和着色,您可以在C:\中找到它程序文件\ Microsoft Visual Studio 11.0 \ Common7 \IDE适用于32位版本的Windows或C:\Program Files(x86)\ Microsoft Visual Studio 11.0 \ Common7 \IDE适用于64位版本的窗口。



您可以使用任何简单的文本编辑器(如记事本或wordpad)打开和编辑文件。



Kip Irvine已经完成了一个关于如何修改VS 2012来处理VS 2012中的ASM文件的完整博客,你可能会觉得这很有用



http://kipirvine.com/asm/gettingStartedVS2012/index.htm [< a href =http://kipirvine.com/asm/gettingStartedVS2012/index.htmtarget =_ blanktitle =新窗口> ^ ]



这包括直接从VS 2012中调用外部程序,这可能也会让你感兴趣。
Please ignore Sergey's answer he was trying to be smart and failed.

Yes you can control the keyword recognition and colourization which is held in a user data file called Usertype.dat which you will find in "C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE" for 32 bit versions of windows or "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE" for 64 bit versions of windows.

You can open and edit the file with any simple text editor like notepad or wordpad.

Kip Irvine has for example done a full blog on how to modify VS 2012 to deal with ASM files in VS 2012 which you might find helpful

http://kipirvine.com/asm/gettingStartedVS2012/index.htm[^]

That includes setting up call the external program directly from within VS 2012 which might also interest you.


这篇关于在VS2012中非常简单的语法着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆