The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

autoswap_i3

asked 2013-12-13 16:14:33 +0000

cg gravatar image

Hi, I just came across the autoswap_mac plugin for Vim by Damian Conway and was wondering if someone had already ported it to i3?

Short summary of what that plugin does (at least part of):

if you try to edit a file with Vim and it is already open in another Vim session in another terminal, it exits Vim and sets focus to the terminal containing the other Vim session.

If you search for OSCON 2013: "More Instantly Better Vim" - Damian Conway on YouTube you will get a better explanation by the author (from minute 12 on).

edit retag flag offensive close merge delete

Comments

Perhaps I can put the link in a comment, if not in the main post: http://www.youtube.com/watch?v=aHm36-na4-4#t=12m01s

cg gravatar imagecg ( 2013-12-13 16:15:18 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-12-15 16:53:52 +0000

vandannen gravatar image

you can use, e.g., xdotoolto make it work with X, as you only need to change the detection of the active window and the focus switching. here is a diff: http://pastebin.com/4XuJXmMq

edit flag offensive delete link more

Comments

thanks, but this doesn't bring the workspace in focus that window is on for me, I'll see if I can fix this in the next days (also: sorry cannot upvote you, for lack of karma)

cg gravatar imagecg ( 2013-12-17 14:21:36 +0000 )edit

oh, this seems to be a problem with xdotool, but it works with i3-msg. try this: http://pastebin.com/CYpavBzr

vandannen gravatar imagevandannen ( 2013-12-17 15:58:21 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2013-12-13 16:14:33 +0000

Seen: 183 times

Last updated: Dec 15 '13