Category Archives: vim

Vim Syntax Highlighting for LessCSS

>Here’s a quick HOWTO for enabling vim syntax highlighting for .less (lesscss) files:

  1. Create the directory ~/.vim/syntax/ if it does not exist yet.
  2. Download the vim syntax file less.vim into that directory, e.g. with the command:
  3. Make sure the following statements are in your ~/.vimrc:
    syntax on
    au BufNewFile,BufRead *.less set filetype=less

That’s all.

Update (Sept. 25, 2009): Here’s a screenshot:

Leave a comment

Posted by on 20 August 2009 in howto, less, lesscss, syntax, syntax highlighting, vim


>Eclipse on Mac OS X

Because I wanted to apply some automated refactoring, I decided to give Eclipse a chance, after sticking with Vim for years. I tried other tools, but always fell back to Vim, because it just works very good for me.

Here’s some of the things I found:

  • Creating a new project from an existing Ant build file works flawlessly.
  • The look-and-feel is not exactly Mac-like, but the integrated window with panels inside are a lot more screenspace-efficient than the floating windows that typical Mac applications (e.g. Keynote) offer.
  • Customizing Java code style preferences is intuitive and powerful.
  • Keyboard shortcuts are properly converted to Ma-style (e.g. Shift-Cmd-L).
  • The Save As command is not bound to the standard keybaord shortcut Shift-Cmd-S. Instead, this keyboard combo saves all files.
  • Refactoring tools work very well.
  • By default, the Javadoc for the JDK is not found, so hovering over a JavaSE class, such as java.lang.Object, does not show a description, but rather an error message. I would expect this to be standard functionality, perhaps offered as an option during installation or at least as a warning (e.g. “Unable to find Javadoc for JDK”).
  • There does not seem to be a way to indent variable declarations like this:
int       groupCount = groups.length;
int itemGroupSpacing = _config.getItemGroupSpacing();
  • Code completion is more advanced than in Vim; the alternative for Ctrl-P in Vim seems to be Ctrl-Period in Eclipse, but Eclipse also offers Ctrl-Space.
  • Cmd-P shows a Page Setup dialog, instead of a standard Print dialog.
  • The About dialog is referenced both from the program menu and from the Help menu.
  • Triple-click (with the left mouse button) does not select the whole line. This is a typical mouse shortcut with editors.

I tested Eclipse 3.2.1. The current version may be (even) better.

Leave a comment

Posted by on 6 August 2007 in ant, eclipse, java, refactoring, vim