Notepad ++中的语法突出显示:如何将用户定义的语言视为内置语言? [英] Syntax Highlighting in Notepad++: How to treat a user-defined language as built-in?

查看:116
本文介绍了Notepad ++中的语法突出显示:如何将用户定义的语言视为内置语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常小的问题,尽管如此困扰了我好几个月.我已经花了几个小时在Google上搜寻,但无济于事.

This is a very minor issue that has nonetheless annoyed me for months. I've spent hours Googling it to no avail.

要在Notepad ++中启用.ahk文件的语法高亮显示,我已经下载了&导入了AutoHotkey的.xml文件.问题是-要启用此突出显示-我必须从语言"下拉菜单中手动选择它.我希望每当打开.ahk文件时都启用它,就像其他各种语言一样.

To enable syntax highlighting of .ahk files in Notepad++, I've downloaded & imported an .xml file for AutoHotkey. The issue is that- to enable this highlighting- I have to manually select it from the "Language" drop-down. I'd like to it to be enabled whenever an .ahk file is opened, as it is for various other languages.

我尝试在样式配置器中将.ahk扩展名添加到AutoIt语言中,这对我没有任何帮助.有任何想法吗?我不能成为第一个被这个烦恼的人,但是我没有成功问过Google.

I've tried adding the .ahk extension to the AutoIt language in the Style Configurator, which does nothing for me. Any ideas? I can't be the first person to have been annoyed by this, but I haven't been able to ask Google with any success.

推荐答案

它应该可以正常工作.再次检查:

It should be working. Check again:

  1. 转到Settings → Style Configurator,选择您的语言,然后在User ext.中添加ahk扩展名(不带点!).
  2. 如果这是一种用户定义语言,请转到Language → Define your language,然后从下拉列表中选择您的语言,然后在将出现的名为Ext.的文本框中添加您的"ahk"扩展名.
  3. 确保仅将ahk扩展名定义为AutoHotKey,而不是同时使用两种语言(因此请从AutoIt中删除该扩展名).
  4. 如果仍然无法正常运行,请检查您的Notepad ++版本.最新版本是6.5.1,以前的版本可能有错误.
  1. Go to Settings → Style Configurator, select your language and add in the User ext. the ahk extension (without a dot!).
  2. If it's a User Defined Language, then go to Language → Define your language, then select from the dropdown list your language, and in the text box named Ext. that will appear, add your "ahk" extension.
  3. Make sure that the ahk extension is defined ONLY to AutoHotKey, not in two languages simultaneously (so remove the extension from AutoIt).
  4. If it's still not working, check your Notepad++ version. Latest is 6.5.1, previous versions might had a bug.

这篇关于Notepad ++中的语法突出显示:如何将用户定义的语言视为内置语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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