Created
April 1, 2015 08:53
-
-
Save shellfly/7f712694ee693e8ca5b0 to your computer and use it in GitHub Desktop.
emacs functions for Django template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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