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
    CSS @supports

    Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn't been available within CSS.  What we end up doing is repeating the same properties multiple times with each browser prefix.  Yuck.  Another thing we...

  • By
    Facebook Open Graph META Tags

    It's no secret that Facebook has become a major traffic driver for all types of websites.  Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly.  And of course there are Facebook "Like" and "Recommend" widgets on every website.  One...

Incredible Demos

  • By
    MooTools: Set Style Per Media

    I'd bet one of the most used MooTools methods is the setStyle() method, which allows you to set CSS style declarations for an element. One of the limitations of MooTools' setStyle() method is that it sets the specific style for all medias.

  • By
    Chris Coyier’s Favorite CodePen Demos II

    Hey everyone! Before we get started, I just want to say it's damn hard to pick this few favorites on CodePen. Not because, as a co-founder of CodePen, I feel like a dad picking which kid he likes best (RUDE). But because there is just so...

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!