In the 90s when I was first administering my Linux/FreeBSD machines, admittedly I used pico and nano far too often, Linux’ equivalent of notepad. When I discovered and learned to use vim, I fell in love. Today, I use it to edit configuration files, CSS, JavaScript, websites, source code — everything.
While I still use a graphical IDE (Zend/Eclipse) on larger projects from time to time for better code completion, embedded help and the other fancy features it provides, a day doesn’t pass by where I don’t find myself using vim and the command line to solve a problem.
Vim doesn’t care where I am. If I’m using my macbook, my ubuntu desktop at the office, a freshly installed OS, my phone, my windows machine, on a friend or family’s PC, I can get into my servers, into my source code and I can make changes using my trusty vim.
Working with other developers, especially the younger ones, I notice that they come from an age where you don’t need to know command line linux tools to be considered a developer. I find that rather odd. So often a question comes up that I answer with brevity relying on pipes and with tools like vim, grep, sed and awk. To them, the command line is frightening and antiquated. How wrong they are.
In my eyes, not having these tools at your disposal is a serious and frightening handicap. The sheer amount of “busy work” that they perform, be it copy and pasting, trying to find something that goes beyond a simple search, or making a repetitive edit to a file is a huge waste of time and likely to turn your brain into mush.
Firstly, for anyone who isn’t yet familiar with vi or vim, I strongly suggest the following book from O’Reilly. This is one of my favorite books because it’s packed with information and it’s extremely easy to follow:
http://oreilly.com/catalog/9780596529833/
Secondly, I want to post my default ~/.vimrc file, which is a configuration file for vim that enabled tabs-as-spaces, syntax highlighting and a few other handy options:
:set backspace=start,indent,eol syntax on :set expandtab :set tabstop=4 :set nu :set autoindent :retab :set shiftwidth=4 autocmd BufWritePre * :%s/\s\+$//e set showmatch :colo pablo
