Giorgio Cefaro

Software Engineer

My PHP developer toolbox

Lately, but not too late, I've been experimenting with some tools for making my developer life easier. This post is meant to share them, and eventually integrate them with your valuable feedback.

First of all, let's talk about the shell. I must admit I was lazy, accepting the default ubuntu one, Bash, with its default configuration.
Then, one day I discovered Zsh and it was love at first sight.

Zsh

Zsh is a shell designed for interactive use, although it is also a powerful scripting language

I must admit I'm not a *sh scripting ninja, but the zsh community seems very active and you can find tons of useful scripts on the web. The set of scripts I think is a must is oh-my-zsh, a powerful and huge set of themes and plugins integrating almost everything I make a daily use of.

Here comes a brief tutorial for you lazy people who needs to be spoon-fed:

As you can see I've added a lot of plugins that basically gives you shortcuts to most used commands and other fancy stuff. The most useful thing here is the git plugin, that gives you a dynamic visual representation of the state of your current git tree (if available). An image here comes handy:

Can you feel the powa?
What we can see here is this: we are in a git-versioned directory, we are on master branch and we have uncommitted changes (the yellow dot).
As I mentioned before, there's a bunch of plugins available you can choose from, for an exaustive guide go here.

You can choose among a lot of themes too, have a look here.
And, guess what, if oh-my-zsh is not enough and you become a zsh ninja you can do other gazillions of wonderful things!

Another topic worth to mention is diffing files. Sometimes reading a diff on the shell it's just a pain, even if with time you can be very skilled to do it.
What I propose here is using visual diff tools, like Meld.

VIsual diff - Meld

Meld is a great graphical diff tool, available as a package in almost any popular linux distro. It can compare files and directory trees.
Satisfied with the software per se, what I wanted was an integration with git, in order to display diffs in a graphical, intuitive way.
I found a great tutorial by Nathan Hoad, with which I made it happen.

Last but not least I discovered tmux to be quite handy as a replacement of the screen command.

tmux

mux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

When you are lost between production, staging, local and so on, you can split your terminal in different areas, each running a different shell. Another image will help here: