A piece of intertube about the Clojure programming language, algorithms and artificial intelligence.

Wednesday, April 20, 2011

Fed up with typing ns declarations?

While watching the demonstration video of the Play framework, I saw that the developer had some nice templates for its TextMate editor. A few Google searches tells us that it is also possible to have the same functionality in Emacs with the YASnippet template system.

Typing all these long namespaces declarations in Clojure is quickly boring when you create a lot of files, so why not create a template for that?

After having installed YASnippet, create a clojure-mode directory inside the yasnippet/snippets/text-mode directory and create a file named ns with this content: