Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know in notepad++ i can use mouse doubleclick to select whole word, but i want to use some keybord shortcut. For example in visual studio it's ctrl+w by default and it's very useful. Can i specify shortcut for that action in notepad++ or does it exists?

share|improve this question

4 Answers 4

up vote 4 down vote accepted

Might be a better way (and there may be unintended side-effects of this), but from poking around a bit:

Settings, Shortcut Mapper, Plugin Commands, 49 Q:Mark Word or Find Reverse, Modify, then Choose your Shortcut Combination.

Note that Ctrl-W is close by default in Notepad++, so unmap that first (Shortcut mapper, Main Menu) if you want to use that.

Edit: After ten more seconds of poking around, the crippling unintended side-effect of this solution is somewhat obvious. Namely, try this is a test test and then try select test. ;) Sorry.

share|improve this answer
    
That works fine for me –  x2. Mar 25 '11 at 5:25
    
I've read about test test(think it's regex problem ot something) and now don't know what better macro or that decision :( –  x2. Mar 25 '11 at 5:38

My autohotkey solution, mapping Ctrl-click to select word:

; Allow Ctrl-Click to select current word in notepad++
#IfWinActive ahk_class Notepad++
; Note from Help: The hotkeys Shift::, Alt::, and Control:: fire upon release of the key unless they have the tilde prefix such as ~Alt::. By contrast, a specific left or right hotkey such as LAlt:: fires when it is pressed down.
~Control::
KeyWait, LButton, D T0
if ErrorLevel = 0
{
    Click 2
}
return
#IfWinActive
share|improve this answer

I use autohotkey to achieve the same goal. The combination was Ctrl+F+Esc

Ctrl+F select the current word for you, Esc dismiss the Find window.

And it did the trick.

(In SourceInsight there was a default action for this, very useful :)

share|improve this answer

I couldn't find a built-in command to do this, but I found a way to replicate this functionality.

  1. Open or create any text file with more than one word in it.
  2. From the Macro menu, select Start Recording.
  3. Press Ctrl+← Left. The caret (insertion point/I-beam) will move to the beginning of the word.
  4. Press Ctrl+Shift+Right →. The word will be highlighted.
  5. From the Macro menu, select Stop Recording.
  6. Again from the Macro menu, select Save Current Recorded Macro.
  7. In the box that appears, assign any name you would like, and select a keyboard shortcut for it. Then click OK.

Your assigned shortcut will now highlight the word the caret is currently inside, except for when the caret is immediately to the left of the first letter of the word, in which case it will select the previous word.

If you need to be able to select a word when the caret is immediately to the left of the word, perform the above steps but alternate the left and right keys, so the caret moves to the right of the word and highlights to the left. In that case it would select the following word if the caret is immediately to the right of the word. You can create shortcuts for both if you desire.

I would hope there's a better way, but I couldn't find one. If someone else knows of one, feel free to provide it and downvote this answer.

share|improve this answer
    
nice answer, thanks –  x2. Mar 25 '11 at 5:25
1  
ctrl + [shift +] left|right work in many applications, it's a good idiom to use through-out your computer. Its awesome in addressbars that support it. Additionally, ctrl+del or ctrl+backspace do something similar. –  Ape-inago Mar 25 '11 at 7:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.