Select the Current Word

Tips Search

If you like the tips then you'll love the book!

Order your copy today:
http://www.amazon.com/gp/product/0735649928

Select the Current Word

  • Comments 11

Keyboard:  CTRL + W
Command:  Edit.SelectCurrentWord
Versions:  2008,2010
Published:  4/5/2010
Code:  vstipEdit0039

 

Download the seriously cool Tip of the Day Extension to get the daily tips delivered to your Start Page!

 

You can easily select the current word in Visual Studio by simply putting your cursor in the word to select:

image

 

Then press CTRL + W and it will automatically select the current word:

image

  • Hi,

    it's much better to simply click CTRL+LMB (left mouse button). Also, don't forget that you can use ALT+LMB (drag while holding left mouse button) to select an arbitrary region within your code.

    Looking forward to VS 2010 launch. I'm preparing a major re-install; it's time to clean up after numerous VS/TFS beta installs.

  • Anders,

    Good call on the mouse info!

    Z

  • Anders,

    CTRL+LMB requires leaving the keyboard, which is much less efficient.

  • This does not work for me. Ctrl+W prompts for a second key to be pressed as if Ctrl+W is only reserved for combination commands. Am I missing something?

  • This is a VS2010 ONLY feature!

  • But I am using VS2010 and it's still not working.

  • mrjimmy and lewis,

    This works in both VS2008 and VS2010.  It is most likely your keyboard mapping scheme.  I use the default mapping scheme for these posts.  Look for a post soon on how to check you have the correct mapping scheme.  

    Z

  • Thanks for posting this - it will be handy for the upcoming VS2010 release :)

  • That explains it. I was on the Visual C# 2005 mapping for some reason. I don't remember ever switching it though. I moved it back to default and it's working fine. Thanks for the heads up!

  • Ctrl + w is nice, great post. The ctrl + LMB is a little unnecessary imho. Why hold ctrl when you can just double click for the same result?

  • Greg,

    Good point! :)

    Z

Page 1 of 1 (11 items)
Leave a Comment
  • Please add 5 and 5 and type the answer here:
  • Post