Skip to content

Instantly share code, notes, and snippets.

@juxtin
Last active August 29, 2015 14:08
Show Gist options
  • Save juxtin/fc152680a04ceffb5338 to your computer and use it in GitHub Desktop.
Save juxtin/fc152680a04ceffb5338 to your computer and use it in GitHub Desktop.
Create a new Leiningen project in Emacs and open its project.clj file
(defun new-lein-project (name &optional template)
"Interactively ask for a project and optional template name,
then create a Leiningen project with the parameters
and open its project.clj file."
(interactive "sProject name: \nMTemplate (optional): ")
(shell-command-to-string
(concat "cd ~/src && " ;; change this to the directory where you keep your projects
"lein new "
template
" " name))
(find-file (concat "~/src/" name "/project.clj"))) ;; change it here, too
@juxtin
Copy link
Author

juxtin commented Oct 26, 2014

Caveat: I do not "know" elisp. There are probably at least 10 things here that can be done better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment