Playing with Vim and Laravel

Reading Time: 2 minutes
I love using Atom because it’s light and fast, even on a six year old machine like mine. Github is soon going to archive atom. I will lose my favourite editor. That’s why I played with VS Code, Sublime Text and other solutions. Vim is the winner for now.

Vim is on every linux and mac machine, and can be installed on Windows. Out of the box Vim is a really simple, limited editor but if you invest the time, to find plugins, and learn how to use it then it becomes a great application.

This weekend in the process of studying Laravel I decided to use VIM and one of the best features with Vim is that when you’re following a tutorial you will get the file path given to you. Type it into terminal and you’re in the file. No scrolling through hierarchies, no reading through long lists. You go straight to the file and start working.

This is good for production websites too. I am currently in the process of taking the static content on my website and making it dynamic. This requires going to the section index page, seeing a file name and opening it. With vim I see that I want tricycle.html and I type it, and the file is open. This saves a great amount of time.

Vim can feel really slow when you train yourself to use i to insert, esc :wq to save and more, but once these are natural reflexes using Vim speeds up. I find that the more I use it, and the more comfortable I am with simple things, the more willing I am to experiment with additional features, for example option 8 and nine to jump by paragraphs to go up and down documents.

One of the biggest mental hurdles is remembering to work without a mouse, like we did in the eighties. Everything is via the keyboard so you don’t click and drag. You yank and put. You also shift V to select a line and jk up or down to select more lines. You can then delete.

I am not comfortable with cut and pasting yet but that will come with time. Vim is an excellent piece of software, but you need to invest time in learning how to use it.

I like that it’s free, available on almost all machines automatically, and that it’s resource light. There is no need to have a heavy application like Visual Studio Code running, if you learn Vim.