我已经定义了我自己的自定义 vim 文件类型,并带有突出显示等功能。当我双击它时,我想使用基于终端的 vim 打开它。我正在使用 mac os x。关于如何开始的任何指示?
gho*_*ppe 19
创建一个 Automator 应用程序来运行以下 applescript:
on run {input}
set the_path to POSIX path of input
set cmd to "vim " & quoted form of the_path
tell application "System Events" to set terminalIsRunning to exists application process "Terminal"
tell application "Terminal"
activate
if terminalIsRunning is true then
do script with command cmd
else
do script with command cmd in window 1
end if
end tell
end run
Run Code Online (Sandbox Code Playgroud)
保存自动机应用程序。(例如,将其命名为Vim Launcher)
右键单击(或按住 Control 单击)您的自定义 vim 类型文件(例如,使用.vim作为扩展名),然后在打开方式下...选择底部选项Other...并找到您的 Automator 应用程序(例如Vim Launcher),双击点击它。
繁荣。
| 归档时间: |
|
| 查看次数: |
13508 次 |
| 最近记录: |