Archive for the ‘Tools’ Category

Integrating JSLint for vim

Saturday, October 3rd, 2009

A couple of months ago I moved away from TextMate and started using vim for most of my text editing needs. I love TextMate, but I needed a powerful text editor that is also available on other operating systems.

Overall I love vim: it has a steep learning curve, but it’s very powerful.If you are touch-typing and loath the mouse as much as I do, it’s fantastic. But I found myself missing out on some of TextMate’s great bundles, and JSLint integration is one of them. After some googling around and looking at different solutions, this is the one that was easiest to install and I like the functionality.

First download & install JavaScript Lint. On OSX & Linux, you can do so by copying the resulting folder into your PATH. I put it in /usr/local/bin/.

Then get the JavaScriptLint vim plugin by Joe Stelmach and restart vim.

Off you go. When you save a JavaScript file in vim, you will get a window with JSLint warnings. If you want to configure JSLint to show/hide certain errors, you can edit the config (jsl.default.conf) in the folder. You might want to backup the file before editing it.

Happy linting!

Upgrading the Subversion command line client on Mac OSX Leopard

Wednesday, May 20th, 2009

OSX Leopard ships with Subversion 1.4.x by default. Since then, SVN has had 2 major upgrades (merge tracking anyone?). To make things easy, there is a binary availableĀ atĀ Collab.net. But unfortunately you need to do some work yourself.

The path of the built in Subversion command line client is different to the one that the Collab.net Community binary is installed to. The following steps will fix this.

Disclaimer – Be careful: when you use the Terminal you are flying without a safety net! No undo & no restore from trash. Do this at your own risk and don’t forget to have an up-to-date backup!!!

  1. install the binary downloaded to Collab.net
  2. open your Terminal and check which version of SVN you are using by typing svn --version. This should say 1.4.x
  3. check which installed instance of SVN the OS is using by typing which svn. This will return the path to the SVN version you are using, which probably is /usr/local/bin/svn
  4. check whether the Collab.net version is installed by going to it: cd /opt/subversion/bin. Doing an ls should show you the subversion files
  5. Backup the current svn location: by going to it (cd /usr/local/bin) and copying it to your desktop or wherever you fancy (mv svn* ~/Desktop/)
  6. now you need to create symlinks to the Collab.net binaries:
    • ln -s /opt/subversion/bin/svn svn
    • ln -s /opt/subversion/bin/svnadmin svnadmin
    • ln -s /opt/subversion/bin/svndumpfilter svndumpfilter
    • ln -s /opt/subversion/bin/svnlook svnlook
    • ln -s /opt/subversion/bin/svnserve svnserve
    • ln -s /opt/subversion/bin/svnsync svnsync
    • ln -s /opt/subversion/bin/svnversion svnversion
  7. That should be it

The beauty is that you only need to do this once. The next time you upgrade your Subversion client, the symlinks will just point to the updated files and everything should be fine. As I said earlier though: only do this if you feel comfortable on the command line.

UPDATE: I have been told that some people seem to have SVN installed in /usr/bin/. Just use the path that is returned by the which svn command. You might also need to use sudo to run some of the command (i.e. move).