Light Table provides a great development environment for Clojure, ClojureScript & JavaScript. With a few tweaks and some of the many plugins you can make Light Table do even more. Here are a few of the tweaks and plugins I use for my development with Light Table.

Some times you work on your code or configuration files and realise you have made more changes than sensibly fit into one commit. Using patches you can easily select only the changes want rather than adding all the changes in a file. You dont even have to create a seperate patch file.

Git is the version control system of choice by most developers, however when it comes to Git Submodules there is some contention as to their value. I have used them successfully and when you understand where they fit in you can use them to benefit your own projects too.

I’ll explain what Git Submodules as well as why some developers are using them and some developers warn you not to.

Using the command line is a powerful and quick way of doing many developer tasks. The command line shell) for Linux & MacOSX is a whole world apart from the very basic experience of DOS. Zsh (Z Shell) makes the Linux & MacOSX shell experience even better.

I learnt to use the command line with bash, the default Linux shell. Although as soon as you play with zsh for a few minutes, you quickly get hooked. zsh gives you lots of features, including:

auto-completion on steroids

command relative completions

navigable completions list

amazingly fast completions

auto corrections for when your fingers slip

custom prompts, a right hand prompt and themes

shared history over all terminals

history sub-string search

You can add libraries to bash and configure it to do these things as well, although I havent seen an projects to help you quickly do so.

This is a popular project that provides an out of the box zsh setup and its really easy to use. However, something is making it a little slow when I tried it on the MacBook Pro and Linux. Comments around this project suggest its written in more of a bash way than zsh, so that may be the reason for a performance slow down.

After a few days I decided to remove oh-my-zsh and try an alternative project.

Prezto has been rewritten by the author who wanted to achieve a good zsh setup by ensuring all the scripts are making use of zsh syntax. It has a few more steps to install but should only take a few minutes extra.

Installing Prezto

In the root of your home account, clone the prezto github project using any git client.

Check that the links have all been created successfully. Type the command ls -la and you should see the following in your terminal (although possibly without colour)

zprezto uses a series of symlinks to configure zsh with lots of nice defaults

I have been thinking of changing the use of sym-links and just have the specific files include the Prezto files first, then add any customisations required. This would help to keep my changes in place when I updated Prezto.

Run zsh

Now you have zsh configured with prezto, its time to try it out. Open a terminal window and run zsh using the command:

zsh

Set zsh as the default shell

To set zsh as our default shell then run the change shell (chsh) command:

chsh -s /usr/bin/zsh

On Ubuntu, this didn’t seem to work. I also had to configure Gnome Terminal to run zsh as a custom command.

Now when I open a new terminal window or tab, the command line is running Zsh.

Showing Git branch by switching on zsh modules

Several of the prezto zsh modules are switched on by default, however Git is not one of them. If you want to see the current branch you are working on in Git then add the git module to the zprezto configuration.

Edit the file ~/.zprezto

Find the section in the file that defined modules to load and add a line with the git module. Here is what that section would look like once you have edited it.

Creating my own prezto theme

The default sorin them is okay, but takes up a bit much room on the prompt than I like.

I created my own theme as a slight variation from the default sorin theme. I removed >>> characters used to separate the prompt from commands as they seemed largely unnecessary. As I only use git then I didnt feel the need to specify the version control tool used (eg. git, mercurial). Finally, I changed the colours round a little.

I kept the right hand prompt as part of my theme. Its a quick way to show the status of any changes in your local git repository.

The prompt shows the current folder name, with any parent folders abbreviated to their initial. The path up to and including the home folder is represented by ~.

When you enter a folder managed by git, then the right hand prompt kicks in and shows icons representing the current git status. Whilst in the folder you can see if you have changes that untracked, deleted or stage. You can easily tell if you are behind or ahead of the default remote repository. You can also see if you have some changes stashed away.

Summary

Whist oh-my-zsh is really simple to use, the Prezto project seems to have maintainters with greater experience of zsh.

On Ubuntu I am using prezto and although it is a bit more involved to understand at first, it runs really really fast. The only thing I wanted to change with prezto was the theme, so not really that much to learn.

Everything that I was doing with oh-my-zsh seems to work in Prezto without adding in extra plugins to the Zsh configuration.

So although oh-my-zsh is a great project, I’d recommend using Prezto to have a great Zsh experience. Take a look at my dotfiles on github (dot-files-ubuntu or dot-files-macosx) to see how I created a custom theme.

Sometimes its the little things that make a difference and after seeing how easily customise the Clojure REPL prompt with Leiningen I had a little hack with words, symbols and colours and came up with something nicer (in my opinion).

nodejs is an important aspect in making JavaScript so popular for modern development and frameworks like Express make development with node more productive. It is really easy to get going with nodejs & Express and you can deploy your app live via Heroku too.

Learning to use Git to version your development projects can seem a little strange at first, although once you have a few basics it quickly becomes a natural and fast tool to use.

Here are some of the basics of the Git and Github workflow in word and pictures, created from my mission to teach the world (starting with London) to use Git effectively. If you just want an overview of the basic commands, see my Git Quickstart Guide.