Wednesday, September 15, 2010

Stupid keyboard tricks

This is silly simple, and I can't believe I never thought of it before. As a programmer, I have to chop up text files and repurpose them in various ways all the time. One common example is adding a bunch of boilerplate text to the beginning or end of a series of lines. Up to now I tend to use the mouse to position the cursor and then hit [CTRL+V] to paste the text. Due to time and accuracy needed to position the mouse over and over, this is actually pretty time-consuming and painful. Here's what I came up with today:

The first step is always to get the text you are adding into the copy buffer by typing it out, highlighting it, and hitting [CTRL+C].

For adding text to the beginning of the line:

  • Position the cursor at the beginning of the first line with the mouse or keyboard. Type the following over and over.
  • Type [CTRL+V] [HOME] [DOWN ARROW]

For adding text to the end of the line:

  • Position the cursor at the end of the first line with the mouse or keyboard. Type the following over and over.
  • Type [CTRL+V] [RIGHT ARROW] [DOWN ARROW] [LEFT ARROW]

Because you can get a finger on each one of these keys at the same time, you can actually do this very very fast, typing the keys over and over in a pattern.

No comments: