V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
IndexOutOfBounds
V2EX  ›  Vim

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

  •  
  •   IndexOutOfBounds · 2021 年 11 月 13 日 · 3328 次点击
    这是一个创建于 1526 天前的主题,其中的信息可能已经有所发展或是发生改变。
    7 条回复    2021-11-17 12:23:03 +08:00
    kiwier
        1
    kiwier  
       2021 年 11 月 13 日
    安装超级右键 lite 版
    IndexOutOfBounds
        2
    IndexOutOfBounds  
    OP
       2021 年 11 月 13 日
    @kiwier 这个可行吗?
    我看只有 Open in Terminal ,这个直接把文本文件 当成可执行文件了
    我需要的是 Open in Vim
    minamike
        3
    minamike  
       2021 年 11 月 13 日   ❤️ 1
    有 Alfred 的话 新建一个 workflow 就行
    可以选择用快捷键或者 file action 打开



    imKiva
        4
    imKiva  
       2021 年 11 月 13 日   ❤️ 1
    我写过一个用快捷键在终端的 emacs 里打开的,楼主可以自己修改一下。双击打开的我也没找到什么好办法
    https://gist.github.com/imkiva/a460a57b03db591b1cda9d1fb259f1ed
    lex
        5
    lex  
       2021 年 11 月 13 日   ❤️ 1
    azouever
        6
    azouever  
       2021 年 11 月 14 日   ❤️ 1
    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
        7
    ooops  
       2021 年 11 月 17 日 via iPhone
    用命令行的 file manager 啊 nnn ranger 或者 vim 的,直接打开
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1216 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:46 · PVG 01:46 · LAX 09:46 · JFK 12:46
    ♥ Do have faith in what you're doing.