MacVim Open File In Existing Window

前端 未结 7 1082
我在风中等你
我在风中等你 2020-12-23 02:20

Is there a way to set up MacVim to open a new file in the current window in a running MacVim instance? I currently have the MacVim preference \"Open new files in a new tab i

7条回答
  •  孤城傲影
    2020-12-23 02:30

    I found Azriel's answer great but it does not work if the file does not exist. This little function does the same thing but you can also create new files.

    mvim () { touch "$@" && open -a MacVim "$@"; }
    

    Just add it in your .bash_profile. You can then edit a new file foo as

    mvim foo
    

    and it will open in a new tab.

提交回复
热议问题