Я знаю о MacVim, и в то время как очень хорошо, что я постоянно нахожусь в терминале. Почему имеют два выполнения программ, когда я мог остаться в одном?
Таким образом, вопрос, как я могу сделать VIM (выполненным в iTerm2) текстовым редактором по умолчанию?
См. мой ответ здесь, но используйте Выполнение действие AppleScript в Automator вместо этого и используйте следующий код AppleScript:
on run {input, parameters}
if (count of input) > 0 then
tell application "System Events"
set runs to false
try
set p to application process "iTerm"
set runs to true
end try
end tell
tell application "iTerm"
activate
if (count of terminals) = 0 then
set t to (make new terminal)
else
set t to current terminal
end if
tell t
tell (make new session at the end of sessions)
exec command ("vim \"" & POSIX path of first item of input as text) & "\""
end tell
if not runs then
terminate first session
end if
end tell
end tell
end if
end run
Это откроет новое iTerm окно, если не будет ни одного, иначе новая вкладка, и откройте файл там. Результат: