【发布时间】:2018-11-15 11:12:24
【问题描述】:
如何编写函数以从项目中打开相同的相关文件(例如,server/logfile.txt)?所以,这应该和我所在的项目有关。
projectile-find-file 列出所有这些,而不仅仅是我们有兴趣打开的那个...
【问题讨论】:
标签: emacs projectile emacs-helm
如何编写函数以从项目中打开相同的相关文件(例如,server/logfile.txt)?所以,这应该和我所在的项目有关。
projectile-find-file 列出所有这些,而不仅仅是我们有兴趣打开的那个...
【问题讨论】:
标签: emacs projectile emacs-helm
您可以使用projectile-project-root 函数来扩展相对于您的射弹项目的基本目录的路径,例如。
(when-let ((root (projectile-project-root)))
(find-file-other-window (expand-file-name "server/logfile.txt" root)))
或(when-let、if-let 宏来自最近的 emacses 中包含的 subr-x)
(if-let ((root (projectile-project-root)))
(find-file-other-window (expand-file-name "server/logfilt.txt" root))
(user-error "not projectile project found"))
【讨论】:
也许一种非抛射方式是使用emacs 的bookmarks 功能?对于已经定义的书签C-x r b 会带您到文件并在其中偏移吗?
【讨论】: