如何让 TextMate 识别 ASP.NET MVC Razor 视图的智能感知?
我在 Mac 上使用 TextMate 作为前端设计器,并尝试打开 cshtml (razor) 视图来调整 html,但 html 智能感知不会触发。如何在 cshtml 文件上获取 html 智能感知?
I'm using TextMate on a Mac as a front end designer and trying to open cshtml (razor) views to just tweak html, but the html intellisense does not trigger. How do i get html intellisense on the cshtml files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TextMate 没有 HTML 智能感知。它在某些语言上具有特定于语言的选项卡完成和哑属性完成,但没有任何东西可以接近 Visual Studio 的“智能感知”或 Eclipse 的“内容辅助”。
如果您想使用其 HTML 相关功能,您只需在窗口底部的“语言”菜单中选择 HTML。
也就是说,我刚刚从 随机教程 中保存了一个 .cshtml 示例TextMate 自动将其识别为 HTML,所以我不确定发生了什么。
有几个可用的面向 ASP.NET 的 HTML 包,您尝试过吗?
TextMate doesn't have HTML intellisense. It has language-specific tab completion and dumb attribute completion on some languages but nothing that comes close to Visual Studio's "intellisense" or Eclipse's "content assist".
If you want to use its HTML-related features you only have to select HTML in the "Language" menu at the bottom of the window.
That said, I just saved a sample of .cshtml from a random tutorial and TextMate recognizes it as HTML automatically so I'm not sure what's going on.
There are a couple of ASP.NET oriented HTML bundles available, did you try them ?
以下是我在 textmate 中找到的有关关联文件类型的一些信息。希望它能有所帮助。
https://superuser.com/questions/40506/textmate-file-type-association< br>
http://blog.macromates.com/2007/file-type- detector-rspec-rails
最终,您需要告诉 TextMate 将
html
引擎用于任何具有cshtml
或vbhtml
扩展名。Here's some information I found on associating file types in textmate. Hopefully it will be of assistance.
https://superuser.com/questions/40506/textmate-file-type-association
http://blog.macromates.com/2007/file-type-detection-rspec-rails
Ultimately, you need to tell TextMate to use the
html
engine with any file that has acshtml
orvbhtml
extension.