Finder 里双击文件,如何选择用终端的 vim 打开

2021 年 11 月 13 日
 IndexOutOfBounds
3404 次点击
所在节点    Vim
7 条回复
kiwier
2021 年 11 月 13 日
安装超级右键 lite 版
IndexOutOfBounds
2021 年 11 月 13 日
@kiwier 这个可行吗?
我看只有 Open in Terminal ,这个直接把文本文件 当成可执行文件了
我需要的是 Open in Vim
minamike
2021 年 11 月 13 日
有 Alfred 的话 新建一个 workflow 就行
可以选择用快捷键或者 file action 打开



imKiva
2021 年 11 月 13 日
我写过一个用快捷键在终端的 emacs 里打开的,楼主可以自己修改一下。双击打开的我也没找到什么好办法
https://gist.github.com/imkiva/a460a57b03db591b1cda9d1fb259f1ed
lex
2021 年 11 月 13 日
azouever
2021 年 11 月 14 日
https://www.mattcrampton.com/blog/doubleclick_to_open_in_vim_on_osx/
用 automator 封装 applescript 成一个操作,然后双击文件的时候执行这个操作,我改了改命令那行
on run {input, parameters}

set filename to POSIX path of input

set cmd to "clear && cd `dirname " & filename & "` && vim '" & filename & "'"

tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text cmd
end tell
end tell

end run
ooops
2021 年 11 月 17 日
用命令行的 file manager 啊 nnn ranger 或者 vim 的,直接打开

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/815121

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX