Skip to content

Instantly share code, notes, and snippets.

@shellfly
Created April 1, 2015 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shellfly/7f712694ee693e8ca5b0 to your computer and use it in GitHub Desktop.
Save shellfly/7f712694ee693e8ca5b0 to your computer and use it in GitHub Desktop.
emacs functions for Django template
(defun goto-template()
"Jump to correspondence Django template file"
(interactive)
(let (tmplName projectDir appName)
(setq projectDir "/home/shellfly/project/src")
(setq tmplName (thing-at-point 'filename))
(setq appName (car (split-string tmplName "/")))
(find-file (concat
(file-name-as-directory projectDir)
(file-name-as-directory appName)
(file-name-as-directory "templates")
tmplName))))
(global-set-key (kbd "C-x g") 'goto-template)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment