IndexOutOfBounds
V2EX  ›  Vim

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

  •  
  •   IndexOutOfBounds · Nov 13, 2021 · 4147 views
    This topic created in 1823 days ago, the information mentioned may be changed or developed.
    7 replies  •  2021-11-17 12:23:03 +08:00
    kiwier
    kiwier
    Nov 13, 2021
    1
    安装超级右键 lite 版
    IndexOutOfBounds
    IndexOutOfBounds
    OP
    Nov 13, 2021
    2
    @kiwier 这个可行吗?
    我看只有 Open in Terminal ,这个直接把文本文件 当成可执行文件了
    我需要的是 Open in Vim
    minamike
    minamike
    Nov 13, 2021❤️1
    3
    有 Alfred 的话 新建一个 workflow 就行
    可以选择用快捷键或者 file action 打开



    imKiva
    imKiva
    Nov 13, 2021❤️1
    4
    我写过一个用快捷键在终端的 emacs 里打开的,楼主可以自己修改一下。双击打开的我也没找到什么好办法
    https://gist.github.com/imkiva/a460a57b03db591b1cda9d1fb259f1ed
    lex
    lex
    Nov 13, 2021❤️1
    5
    azouever
    azouever
    Nov 14, 2021❤️1
    6
    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
    ooops
    Nov 17, 2021 via iPhone
    7
    用命令行的 file manager 啊 nnn ranger 或者 vim 的,直接打开
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   949 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 19:46 · PVG 03:46 · LAX 11:46 · JFK 14:46
    ♥ Do have faith in what you're doing.