我已经用突出显示等定义了自己的自定义vim文件类型。当我双击它时,我想使用基于终端的vim打开它。我正在使用Mac OSX。关于如何开始的任何指示?
创建一个Automator应用程序以运行以下小程序:
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
保存自动化程序。(例如,将其命名为Vim Launcher)
右键单击(或按住Control单击)您的自定义vim类型文件(例如,使用.vim作为扩展名),然后在“打开方式...”下选择底部选项“其他...”,然后找到您的Automator应用程序(例如Vim Launcher),双击点击它。
繁荣。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句