Insert Cursor at Any Position at Command Line

By  on  

As much as I enjoy writing lengthy pieces of JavaScript APIs, techniques, and other tech brilliance, I very much enjoy providing people quick tips to make their daily dev lives better. This is one such post.

Oftentimes I'm working with long command line directives, and as you can imagine, I usually screw up the spelling of a command. Despite being in the industry forever, I didn't know you could click your way to the character position of the problem; I simply held the left or right arrow keys like an absolute caveman.

Did you know...to get to the specific character in the command, you can simply Option-click the character in the command line!

This isn't even clever, I was just to lazy to ever look it up. Huh. Well, now I know, and so do you!

Recent Features

  • By
    From Webcam to Animated GIF: the Secret Behind chat.meatspac.es!

    My team mate Edna Piranha is not only an awesome hacker; she's also a fantastic philosopher! Communication and online interactions is a subject that has kept her mind busy for a long time, and it has also resulted in a bunch of interesting experimental projects...

  • By
    9 Mind-Blowing Canvas Demos

    The <canvas> element has been a revelation for the visual experts among our ranks.  Canvas provides the means for incredible and efficient animations with the added bonus of no Flash; these developers can flash their awesome JavaScript skills instead.  Here are nine unbelievable canvas demos that...

Incredible Demos

  • By
    pointer Media Query

    As more devices emerge and differences in device interaction are implemented, the more important good CSS code will become.  In order to write good CSS, we need some indicator about device capabilities.  We've used CSS media queries thus far, with checks for max-width and pixel ratios.

  • By
    Fullscreen API

    As we move toward more true web applications, our JavaScript APIs are doing their best to keep up.  One very simple but useful new JavaScript API is the Fullscreen API.  The Fullscreen API provides a programmatic way to request fullscreen display from the user, and exit...

Discussion

  1. Aaron

    Found this via feedly. Very useful. I didn’t except it would work while ssh’d into a server running gnu screen, either. Saved me tones of time…

  2. This is a very helpful tip! using the arrow keys sucks especially when you are trying to get to the beginning of a long command.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!