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
    Designing for Simplicity

    Before we get started, it's worth me spending a brief moment introducing myself to you. My name is Mark (or @integralist if Twitter happens to be your communication tool of choice) and I currently work for BBC News in London England as a principal engineer/tech...

  • By
    Interview with a Pornhub Web Developer

    Regardless of your stance on pornography, it would be impossible to deny the massive impact the adult website industry has had on pushing the web forward. From pushing the browser's video limits to pushing ads through WebSocket so ad blockers don't detect them, you have...

Incredible Demos

  • By
    MooTools Kwicks Plugin

    I wrote a post titled Get Slick with MooTools Kwicks ages ago. The post was quite popular and the effect has been used often. Looking back now, the original code doesn't look as clean as it could. I've revised the original...

  • By
    Spatial Navigation

    Spatial navigation is the ability to navigate to focusable elements based on their position in a given space.  Spatial navigation is a must when your site or app must respond to arrow keys, a perfect example being a television with directional pad remote.  Firefox OS TV apps are simply...

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!