如何用外部程序打开org mode中的链接

平台是macos. 如果能用open打开就的好了. 比如.png, 查看的时候我就想用默认的Preview查看. 此外, 我试用了openwith package, 完全不起作用. 我是这样设置的:

(require 'openwith)
  (openwith-mode t)
  (setq openwith-associations '(("\\.pdf\\'" "open" (file)) ("\\.png\\'" "open" (file))))

openwith好像不是用于链接的打开, 根据README, 提到的是C-x C-f, 对于find-file. 但是我用C-c C-f, 打开pdf文件也仍然是用emacs内置的打开的.

(add-to-list 'org-file-apps '("\\.pdf" . default))
1 个赞

我通常是是把希望用外部 Apps 打开的链接用 file+sys: 前缀,例如:

[[file+sys:~/Downloads/xxx.png]]

2 个赞

试过这个, 的确可以, 谢谢!