记事本++选择带连字符的文本 [英] notepad++ select hyphenated text
问题描述
对于一直阻碍使用 notepad++ 的问题,我找不到解决方案.
当您双击文本以突出显示该文本和其他类似文本时,camelCase
或 under_score
词效果很好,但是当 hyphen-words-are-clicked
这不会将其视为单个单词,只会突出显示-"之间的部分.
问题:如何自定义记事本++,以便将带连字符的单词视为单个单词?或者有人知道这样做的文本编辑器吗?
看到了这一点,但不确定如何实现它:http:///sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Word_Customisation
I could'nt find a solution to a problem that has been hindering the use of notepad++.
When you double click text to highlight that text and others like it, camelCase
or under_score
words work great, but when hyphen-words-are-clicked
this does not treat it as a single word and only highlights the segment between the "-".
question: how can you customize notepad++ so that hyphenated words are treated as single words? or does anyone know a text editor that does this?
saw this, but not sure how to implement it: http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Word_Customisation
这真的很有帮助:记录的宏在哪里存储在 Notepad++ 中?
推荐答案
Notepad++ 依赖 Scintilla 进行单词选择.正如 caoanan 在他的回答中注意到的那样,可以使用 SCI_SETWORDCHARS 变量配置 Scintilla.您可以使用简单的 NppExec 脚本在 Notepad++ 中设置此变量:
Notepad++ rely on Scintilla for word selection. As caoanan noticed in his answer, Scintilla can be configured with the SCI_SETWORDCHARS variable. You can set this variable in Notepad++ with a simple NppExec script:
- 安装 NppExec
- 菜单 <代码>插件 ->插件管理器 ->显示插件管理器
- 找到 NppExec,选中复选框并点击安装
创建脚本
- 菜单 <代码>插件 ->NppExec ->执行...
写下这段代码(你可以在列表末尾添加其他字符,比如.$#@):
- Menu
Plugins -> NppExec -> Execute ...
write this code (you can add other characters, like .$#@ at the end of the list):
NPP_CONSOLE 0
sci_sendmsg SCI_SETWORDCHARS 0 "CDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
- 菜单 <代码>插件 ->NppExec ->高级选项...
- 在在 Notepad++ 启动时执行此脚本下拉菜单中选择您的脚本
- Menu
Plugins -> NppExec -> Advanced Options...
- Choose your script in the Execute this script when Notepad++ starts drop down
这篇关于记事本++选择带连字符的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!