虚幻引擎源码跳转
2023年8月12日 2023年11月17日
说明
API会标注类源码路径
源码路径样式
无!
![[file:file.cpp][源码:name]]
需设置引擎源码文件夹
1;; (setq my/ue-source-path "path/to/ue/source")
插入源码路径
1(defun my/insert-ue-source-path () 2 (interactive) 3 (let* ((path (read-string "Path: UE_5.1/Engine/Source/")) 4 (file (car (last (split-string path "/" t))))) 5 (insert (format (concat "[[" "ue:UE_5.1/Engine/Source/%s][虚幻引擎:%s]]") path file)))) 6(global-set-key (kbd "C-c u e") 'my/insert-ue-source-path)
打开源码文件
1(defun my/go-to-ue-source () 2 (interactive) 3 (when (search-backward (concat "[[" "ue:") nil t) 4 (when (re-search-forward (rx "[[" "ue:" (group (0+ (not "]"))) "][虚幻引擎:" (group (0+ (not "]"))) "]]" ) nil t) 5 (let ((file (string-join (mapcar #'string (match-string 1))))) 6 (org-open-file (concat my/ue-source-path "/" file)))))) 7(global-set-key (kbd "C-c u g") 'my/go-to-ue-source)