Using ViM and tmux to increase your productivity
Among the software engineers is a common truth that ViM can do pretty much anything. If you are a developer and you haven’t tried to edit your code using ViM, I definetely would recommend it to do so. For beginners, you can download vim and run
vimtutor, a 15-minute lesson for ViM. In order to really increase your speed of editing code (or text in general), I would say that touch typing is strongly recommended.
sudo apt-get install vim vimtutor
For you those of you that you have a basic knowledge of ViM, here are some tips from mistakes I did and slowed down my learning process:
- Do not use the arrow keys, like ever. Just get used to
hjkl. It’s really useful in order to stay in your home row. Do not commit this action of shame, like I did in the beginning.
- Stay in INSERT mode for the minimum amount of time. Get in INSERT, type some text, and press ESC to go out again. Normally you have to be in NORMAL mode, that’s why it is called “normal”.
- When you finally get used to
hjklas movements, you have to stop using them all the time! Do not press
lmultiple times in order to get to the end of a sentence. Use other motion keys like
w(move to the beginning of the next word), or
)(move to the end of the period).
- Be lazy! Do not press more keys than necessary and you will discover that as time goes by you will not be able to edit text in a regular editor without the perks of ViM. You will get used to be lazy!
The second thing to increase your productivity is using tmux along with ViM. Tmux is a console multiplexer that is very useful if you are used to use the keyboard a lot. You can create new sessions, windows, multiple panes for different workspaces and moving around with keyboard shortcuts. You can, also, write your own customized scripts in order to, for instance, initiate your own session to begin your daily workflow.
I will try to keep my posts as minimal as possible, so I will wrap it up here, with the promise for an extended tutorial on ViM, on how to build a
vimrc and the really awesome plugins that make my daily workflow easier.
Here you can find my configuration files for ViM and tmux. Have fun!