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
this was really helpful: Where are the recorded macros stored in Notepad++?
http://sourceforge.net/p/notepad-plus/discussion/1290590/thread/39ba5cd8/
Install Npp_Exec plugin and copy the string from this thread adding the signs you want Npp considers as part of a word.
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:
Plugins -> plugin Manager -> Show Plugin Manager
Create the script
Plugins -> NppExec -> Execute ...
write this code (you can add other characters, like .$#@ at the end of the list):
Plugins -> NppExec -> Advanced Options...
A workaround is to:
In the Find window, set the text to find to a space
In the Shortcut Mapper (Main Menu section) assign "Find Next" to Ctrl+Right and "Find Previous" to Ctrl+Left
Now, so long as the search text is only a space, it will effectively be the only delimiter. If you need other delimiters, for instance comma and period, set the Find text to [ ,.].
If you don't have admin rights and no Plugin Mgr, you can install most plugins by downloading a dll/zip file and saving the dll to the 'plugins' sub-folder under your npp install. Then restart npp.
I met with the same problem when editing Lisp/Scheme source codes with Notepad++.
The cure lies in the underlying Scintilla library (SciLexer.dll).
I've tried in a "blunt" way -- hack the code and rebuild SciLexer.dll.
Note the '-' added to the following code
CharClassify.cxx
Or, the "smart" way, as mentioned at ScintillaDoc.html
I don't know that option in Notepad++ yet. Since, you've asked about any other text editor that does so, I would recommend you to use Sublime Text. It's a really cool text editor with lots of smart features. I bet you'll love it. By default, it does not treat the hyphenated words as a single word. But it's way too easy to customize the setting for that. All you need to do is go to
'Preference-> Setting-Default'
, where you'll find the following setting:From there, just remove the hyphen and we're done!