The most useful keys on your keyboard

Samer Buna
Oct 26, 2016 · Unlisted
  • 3rd place, the DELETE key, because removing duplicates and bad code is always a joy. Make sure you only refactor well-tested code though!
  • 2nd place, the DOT (.) key, but that’s only if you’re using VIM, you can use the dot key to repeat things. It is also usually helpful in other editors (and Chrome dev tools console) when it is used to check the list of methods you can call on an object.
  • 1st place, the TAB key, because, well, TAB COMPLETION!

(If you’re on Windows, this might not be super useful to you. Sorry for your loss)

So why is TAB so damn good you ask?

  1. Speed
    Type things faster. cd /home/bigNameHere/LongDirectoryNameHere/AnotherLONGNamehereIf you're using TAB after the first few letters of every directory, you will get there a lot faster.
    You don't really need any more reasons after this, but I'll give you more.
  2. Elimination of typing mistakes
    So you typed apt-gt dropping the e, and you can't see that, going crazy over why it did not work, wasted 5 seconds there. if you instead typed apt-g[TAB] to auto complete, this is your GUARANTEE of a typo-free command.
  3. Awareness of commands
    Was that command ifconfig or ipconfig? you don't need to guess or try, type in if[TAB][TAB] to see all the commands starting with if.
  4. Awareness of arguments
    Yep, autocomplete works on arguments too, for example, a quick way to list all directories under your current one is to do cd [TAB][TAB]! since you're trying to cd somewhere, autocomplete will give you all the directories you can cd into, if for example you typed in less [TAB][TAB], then it would show everything you can less.
    Some scripts will take this concept to beautiful extremes, my favorite one is the git-completion script, using that, not only you can see all the git commands you can do with a simple git [TAB][TAB], but you can even see all the flags you can use on all commands. So you can do something like git log --[TAB][TAB] to see the options you can pass to the log command. Pure brilliance.
  5. Text indentation
    Indentation in programming is important, good indentation results in readable and more maintainable code, most editors do simple multiple lines indenting with a single TAB hit, and then you can use shift+TAB to unindent. Don’t use the actual tab character to indent though, make your editor replace a tab with 2 spaces.
  6. The TAB index
    In every HTML document, there is a TAB index, which is the order of elements that you can cycle through using TAB/Shift+TAB, you can use that to reach an input field for example, fill a form without needing to hit the mouse to get the input focus, then to move to the next input in the form, TAB!
  7. CMD+TAB
    You probably know this one, but if you don’t, you’re welcome. CMD+SHIFT+TAB works in reverse here too

Bonus, the least useful key on your keyboard is CAPS-LOCK, I mean, DO YOU REALLY USE IT? I remap it as another Esc, because the original Esc is a bit far from the home-row.

Samer Buna is an author for jsComplete, Pluralsight, and others. His most recent courses are Learning ReactJS and Building Scalable APIs with GraphQL

Unlisted

EdgeCoders

jsComplete’s Medium Publication — jsComplete is a FREE software educational library focused on JavaScript, Node, React & GraphQL. It has video courses, books, articles, and interactive lessons.

Samer Buna

Written by

Author for Pluralsight, O'Reilly, Manning, and LinkedIn Learning. Curator of jsComplete.com

EdgeCoders

jsComplete’s Medium Publication — jsComplete is a FREE software educational library focused on JavaScript, Node, React & GraphQL. It has video courses, books, articles, and interactive lessons.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store