1. 下载userDefineLang_markdown.xml
  2. 打开Notepad++的 Language 菜单,选中底部的 Define your language...
  3. User Define Language 窗口中,点击 Import... 后选中下载的 userDefineLang_markdown.xml
  4. 重启Notepad++
  5. 将文本内容保存为 .markdown.md 后缀即可查看语法高亮效果

语法高亮的XML下载地址
https://github.com/Edditoria/markdown_npp_zenburn

如果通过Windows Installer安装的Notepad++,可以将XML重命名为 userDefineLang.xml 直接拷贝至 %APPDATA%\Notepad++ 生效。
最后一行的语法高亮常常有问题,解决方法是在最后一行文本末尾按下回车。

定制Markdown语法高亮

觉得代码亮粉色不如改为淡墨蓝色,变更上述XML中的

<WordsStyle name="DELIMITERS2" fgColor="FF80C0" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />

<WordsStyle name="DELIMITERS2" fgColor="002D7A" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />

启用Ctrl键多处编辑功能

Settings --> Preferences --> Editing --> Enable(Ctrl+Mouse click/selection)

对多个粗体关键字同时添加** **很有用

Notepad++全局变量

全局变量可用于 Run 中,在Notepad++中按 F5 即可弹出 Run 窗口

$(FULL_CURRENT_PATH) : E:\my Web\main\welcome.html
$(CURRENT_DIRECTORY) : E:\my Web\main
$(FILE_NAME) : welcome.html
$(NAME_PART) : welcome
$(EXT_PART) : html
$(NPP_DIRECTORY) : the full path of notepad++'s directory
$(CURRENT_WORD) : word(s) you selected in Notepad++
$(CURRENT_LINE) : current line number
$(CURRENT_COLUMN) : current column number

相关文章:

  • 2021-12-05
  • 2021-06-22
  • 2021-11-20
  • 2021-06-24
  • 2022-12-23
  • 2021-04-22
  • 2021-07-19
  • 2021-11-23
猜你喜欢
  • 2021-08-05
  • 2021-05-20
  • 2021-12-18
  • 2021-04-06
  • 2022-12-23
  • 2021-11-18
  • 2021-05-28
相关资源
相似解决方案