[Personal project under development, currently implemented only for a MacOS: VSCode/PyCharm + Tmux development environment]
Wormhole is for people who work on multiple projects/repositories concurrently.
When you switch to work on a different project, two things should happen:
- Your editor/IDE should switch to the new project workspace.
- Your terminal emulator should switch to the new project directory / tmux window.
Wormhole makes that be true. It is an HTTP service providing the following commands:
- Switch to a project by name
- Switch to a project given a file path, and open that path in your editor/IDE (at the specified line number)
- Switch to a project given a github URL, and open the corresponding file path in your editor/IDE (at the specified line number)
Wormhole is currently implemented for MacOS only since it uses hammerspoon to work with your window manager. It binds to port 7117 by default.
- Clone this repo
- Check that the editor and other settings in
src/config.rs
are appropriate for your environment - Install hammerspoon and ensure that the
hs
executable is on your$PATH
E.g.brew install hammerspoon ln -s /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs ~/bin
- Start the server with
sudo make serve
Wormhole is an HTTP server. It can be used in various ways, with various HTTP clients. Here are some ideas.
-
Use the MacOS project-switcher UI to switch projects.
-
Wormhole understands GitHub URLs:
Use the requestly chrome extension to send GitHub links to wormhole via rules like:
- URL RegEx
/^https://github.com/([^#]+/blob/[^#?]+)(?:#L(\d+))?$/
Redirect to URLhttp://localhost:7117/$1?line=$2
- URL RegEx
/^https://github.com/([^#]+/blob/[^#]+\?line=\d+)$/
Redirect to URLhttp://wormhole:7117/$1
Now GitHub URLs in Google Docs, Notion, Swimlanes.io, etc will open via Wormhole.
- URL RegEx
-
Open code from terminal applications that create terminal hyperlinks, such as delta and ripgrep.
-
Hammerspoon can send HTTP requests via a keybinding, e.g.
hs.hotkey.bind({ "cmd", "control" }, "left", function() hs.http.get("http://localhost:7117/previous-project/", nil) end)
The fundamental point is that Wormhole opens code in your editor/IDE at the correct line, while ensuring that your editor/IDE selects the correct project workspace for the file, and also switches your terminal emulator to that project.