gioele / vim-autoswap

Please Vim, stop with these swap file messages. Just switch to the correct window!
Creative Commons Zero v1.0 Universal
118 stars 25 forks source link

Add support for iTerm2, and some other MacOS improvements #21

Closed mmrwoods closed 5 years ago

mmrwoods commented 5 years ago

Hi,

I've added support for iTerm2, and made a few other small improvements for MacOS users.

AppleScript support differs in iTerm2 and Apple Terminal, which is why the previous attempt in branch any-terminal-macos failed to work as expected. Also, Hyper terminal does not natively support AppleScript, which is why the code in the same branch didn't work for Hyper.

My changes add explicit support for iTerm2, while retaining basic support for other terminals or GUI programs on MacOS (won't switch to active window, but will at least delete old swap files and open read-only, and without launching Apple Terminal when the user is not using it).

As per Apple Terminal support, the iTerm2 code does not work reliably with tabs as it relies on the window name to match. I've added a note to the readme to explain this limitation (though I think I can fix that issue in iTerm2, it's probably best to leave it for another time).

Fixes #11

gioele commented 5 years ago

Thank you @mmrwoods for the New year's present. :)

mmrwoods commented 5 years ago

@gioele welcome, thanks for merging :-)