Automatically swap your tmux window to a vim file if an newer swap file already exists. If an older swap file exists, it is deleted. If no matching session is found, open read-only.
This is based on this talk from Damian Conway
and derived from the autoswap_mac
code that
can be downloaded here
This works by looking at all tmux
panes and checking
their child processes to look for vim <filename>
. As such,
this won't work if you open a file in a buffer and is
unlikely to work well for opening multiple files, files
with arguments etc.