Created
October 23, 2014 18:25
-
-
Save jasonm23/2fefd69d7f9b24a45def to your computer and use it in GitHub Desktop.
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
(find-file (replace-regexp-in-string "/views/\\(.*\\)" "/view_models/\\1" (buffer-file-name))) | |
(setq jump-list | |
;;- name ------ path in -------- name match -------------------------------- name replacement ---- | |
;; javascript/ | |
;; airdrilling/ | |
'(templates ("/templates/" "/templates/\\(.*\\)\\(\\.hamlc\\)" "/templates/\\1.hamlc") | |
view_models ("/view_models/" "/view_models/\\(.*\\)\\(\\.js.coffee\\)" "/view_models/\\1\\2") | |
views ("/views/" "/views/\\(.*\\)\\_view\\(\\.js.coffee\\)" "/views/\\1_view\\2"))) | |
(car (cdr (assoc-string "views" jump-list))) | |
(car (cdr (assoc-string "view_models" jump-list))) | |
(car (cdr (assoc-string "templates" jump-list))) | |
(defun get-path-for (s) (nth 0 (car (cdr (assoc-string s jump-list))))) | |
(defun get-regex-for (s) (nth 1 (car (cdr (assoc-string s jump-list))))) | |
(defun get-replace-for (s) (nth 2 (car (cdr (assoc-string s jump-list))))) | |
(get-path-for "templates") | |
(get-path-for "views") | |
(get-path-for "view_models") | |
(plist-get jump-list 'templates) | |
(plist-get jump-list 'views) | |
(plist-get jump-list 'view_models) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment