1. 安装NeoVim和iTerm2 (实际上自带的Terminal也可以,这里以iTerm2为例)
  2. 打开Automator,选择创建Application
  3. 添加步骤Run AppleScript,使用下面的脚本:
on run {input, parameters}
	
	set nvim to "/usr/local/bin/nvim "
	set filepaths to ""
	if input is not {} then
		repeat with currentFile in input
			set filepaths to filepaths & quoted form of POSIX path of currentFile & " "
		end repeat
	end if
	
	if application "iTerm" is running then
		tell application "iTerm"
			create window with default profile command nvim & filepaths
		end tell
	else
		tell application "iTerm"
			tell current session of current window
				write text nvim & filepaths
			end tell
		end tell
	end if
end run
  1. 将文件保存到/Applications
  2. (optional)添加NeoVim图标
    1. 下载neovim-mark.png
    2. 复制到剪切板
    3. 右键NeoVim应用,选择Get Info
    4. 点击上面的icon,粘贴
  3. 右键想用neovim打开的文档,选Open With Other... 选择NeoVim,勾选`Always Open With

参考:https://gregrs-uk.github.io/2018-11-01/open-files-neovim-iterm2-macos-finder/`