六一的部落格


关关难过关关过,前路漫漫亦灿灿。




项目源码路径样式

无!

!=ShootThemUp: Weapon/STUBaseWeapon.h=

需设置项目文件夹

1;; (setq my/ue-project-path "path/to/ue/project")

插入项目源码链接

 1;; (defun my/insert-ue-project-source-path ()
 2;;   (interactive)
 3;;   (let ((proj (read-string "Project: (Default - ShootThemUp)"))
 4;;         (type (read-string "Category: "))
 5;;         (file (read-string "File: "))
 6;;         (path)
 7;;         (attr))
 8;;     (if (string= "" proj)
 9;;         (setq proj "ShootThemUp"))
10;;     (when (string= "" type)
11;;       (insert (format (concat "[[" "uep:%s][%s:%s]]") file proj file)))
12;;     (unless (string= type "")
13;;       (if (string-suffix-p ".h" file)
14;;           (setq attr "Public")
15;;         (setq attr "Private"))
16;;       (setq path (format "%s/%s/%s" attr type file))
17;;       (insert (format (concat "[[" "uep:%s][%s:%s/%s]]") path proj type file)))))
18;; (global-set-key (kbd "C-c u p") 'my/insert-ue-project-source-path)

打开源码文件

 1(defun my/go-to-ue-project-source ()
 2  (interactive)
 3  (when (search-backward (concat "[[" "uep:") nil t)
 4    (when (re-search-forward (rx "[[" "uep:" (group (0+ (not "]"))) "][" (group (0+ (not ":"))) ":" (group (0+ (not "]"))) "]]" ) nil t)
 5      (let (
 6            (file (string-join (mapcar #'string (match-string 1))))
 7            (proj (string-join (mapcar #'string (match-string 2))))
 8            )
 9        (org-open-file (format "%s/%s/Source/%s/%s" my/ue-project-path proj proj file))
10        )
11      )
12    )
13  )
14(global-set-key (kbd "C-c u l") 'my/go-to-ue-project-source)

虚幻引擎项目源码跳转



项目源码路径样式

无!

!=ShootThemUp: Weapon/STUBaseWeapon.h=

需设置项目文件夹

1;; (setq my/ue-project-path "path/to/ue/project")

插入项目源码链接

 1;; (defun my/insert-ue-project-source-path ()
 2;;   (interactive)
 3;;   (let ((proj (read-string "Project: (Default - ShootThemUp)"))
 4;;         (type (read-string "Category: "))
 5;;         (file (read-string "File: "))
 6;;         (path)
 7;;         (attr))
 8;;     (if (string= "" proj)
 9;;         (setq proj "ShootThemUp"))
10;;     (when (string= "" type)
11;;       (insert (format (concat "[[" "uep:%s][%s:%s]]") file proj file)))
12;;     (unless (string= type "")
13;;       (if (string-suffix-p ".h" file)
14;;           (setq attr "Public")
15;;         (setq attr "Private"))
16;;       (setq path (format "%s/%s/%s" attr type file))
17;;       (insert (format (concat "[[" "uep:%s][%s:%s/%s]]") path proj type file)))))
18;; (global-set-key (kbd "C-c u p") 'my/insert-ue-project-source-path)

打开源码文件

 1(defun my/go-to-ue-project-source ()
 2  (interactive)
 3  (when (search-backward (concat "[[" "uep:") nil t)
 4    (when (re-search-forward (rx "[[" "uep:" (group (0+ (not "]"))) "][" (group (0+ (not ":"))) ":" (group (0+ (not "]"))) "]]" ) nil t)
 5      (let (
 6            (file (string-join (mapcar #'string (match-string 1))))
 7            (proj (string-join (mapcar #'string (match-string 2))))
 8            )
 9        (org-open-file (format "%s/%s/Source/%s/%s" my/ue-project-path proj proj file))
10        )
11      )
12    )
13  )
14(global-set-key (kbd "C-c u l") 'my/go-to-ue-project-source)