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
    Conquering Impostor Syndrome

    Two years ago I documented my struggles with Imposter Syndrome and the response was immense.  I received messages of support and commiseration from new web developers, veteran engineers, and even persons of all experience levels in other professions.  I've even caught myself reading the post...

  • By
    Being a Dev Dad

    I get asked loads of questions every day but I'm always surprised that they're rarely questions about code or even tech -- many of the questions I get are more about non-dev stuff like what my office is like, what software I use, and oftentimes...

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
    Digg-Style Dynamic Share Widget Using the Dojo Toolkit

    I've always seen Digg as a very progressive website. Digg uses experimental, ajaxified methods for comments and mission-critical functions. One nice touch Digg has added to their website is their hover share widget. Here's how to implement that functionality on your site...

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!