Did you know… How to transpose characters, words, and lines in the editor? – #021

Transpose example

  • Press Ctrl+T to transpose a character
  • Press Ctrl+Shift+T to transpose a word
  • Press Alt+Shift+T to transpose a line

In the above example (where the cursor is placed before the "is" on the commented line "now is the time"),

  • Pressing Ctrl+T will swap the ‘i’ and the previous space, creating  // nowi s the time
  • Pressing Ctrl+Shift+T will swap the "is" and "the", creating // now the is time
  • Pressing Alt+Shift+T will swap the current line with the line below it

Just out of curiosity, I’d love to know how people use this feature, so please leave me a comment. 

Technorati tags: VS2005Tip, VS2008Tip

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>