2 Tips to Code Faster
Tags: typefast, vim
Published: 2021-07-21 13:57:40

# 1. Increase your typing speed
The faster you can type, the faster you can put your thoughts into code. The more time you save typing, the more time you can spend on thinking and improving your code.

Head over to https://www.typingtest.com/ and check how fast you can type.

Are you satisfied with your score? Do you want to improve your score?

Don't worry, you can easily improve your typing speed by following a simple, well-documented but often not known technique.

![Typing Color Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osj4jz2zzvbibgfpcxps.png)

It's pretty simple. You got to follow these rules.

1. You position your fingers on these keys **(a,s,d,f)(<space>)(j,k,l,;)**. The row these keys (except <space>) are at is called the **home row**.
2. You use the respective finger (as indicated by the color code) and **only that finger** to type the character.
3. Once you type your character, you reposition your fingers back to the home row.

Now, when you start, this will do the opposite of what you want. It will decrease your typing speed. But that's part of unlearning what you are used to doing.

You might get frustrated and tempted to go back to the old way of typing. But just trust me and keep at it. It may take a month or so, but eventually, you will be typing way faster than what you are capable of doing right now.

You also won't need to look at the keyboard anymore once you get used to this.

# 2. Avoid the mouse
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rk98m7el1giph0t2j92i.jpg)

What's faster?
[alt + tab] or using the mouse to switch to the previous window?
[alt + f4] or clicking on the x button?
[ctrl + t] or clicking on the new tab button?

Sure using the mouse is simple, intuitive, and user-friendly, but it is damn slow.

Now if you are convinced that using the mouse is slower than using the keyboard, then as yourself this question.

**How much time you are wasting while coding by using the mouse?**

Just like the other things I mentioned above, all those scrolling, clicking, selecting, etc. you do with the mouse while coding takes up a lot of time and slows you down.

That's why it is better to use an editor which allows you to do all the things which typically require a mouse without a mouse!

Vim is one such editor. Emacs is another. There are probably more, but these are the two well-known ones.

I have been a vim user for a long time, so I recommend using vim while coding.

Now similar to getting used to the new typing technique, you will feel it is incredibly counterintuitive and hard to use vim at first. But don't give up, just keep at it, and using vim will become second nature to you.

You may have seen vim on the cli only. Although vim (in its truest form) only works on the cli, there are usually plugins in editors which allow you to enable vim like typing in your IDE. I use [vim plugin](https://marketplace.visualstudio.com/items?itemName=vscodevim.vim) with vscode.

# Conclusion
I know these techniques work because I have used them myself and I see a big difference in the speed at which I code.

But the key to success using these techniques is practice and persistence. Getting used to these takes time and patience, but it is all worth it in the end.