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

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

问题描述

这是一个非常小的问题,但已经让我恼火了几个月.我花了几个小时在谷歌上搜索它无济于事.

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. 如果它是用户定义的语言,则转到语言→定义您的语言,然后从下拉列表中选择您的语言,然后在名为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天全站免登陆