Rebuild hed and replace the running process with the new binary, without losing your open buffers.
:reload
Steps:
- Run
make -j16in the current working directory. - If the build fails, abort and surface the status to you.
- If it succeeds, ask the
sessionplugin to write the open-buffer list to~/.cache/hed/<encoded-cwd>/session. - Set
HED_RELOAD=1in the environment. execl ./build/hed. Same PID, fresh code.
After exec, the new process sees HED_RELOAD=1, reads the session
file via the session plugin's HOOK_STARTUP_DONE handler, reopens
your buffers, and removes the session file.
Reload is the only sensible name for a "rebuild and exec myself" command, but the persistence half — saving and restoring the open- buffer list — is reusable. So:
reloadowns the build / exec mechanic.sessionownssession_save/session_restoreand theHED_RELOADenv var contract.
If you load reload without session, :reload still rebuilds and
relaunches, but doesn't reopen buffers.
- Assumes the cwd is the repo root and that
./build/hedis the output. If you run hed from elsewhere,:reloadwon't find the binary to exec. - The build step uses
make -j16. Editplugins/reload/reload.cif you want a different parallelism. - Default leader binding:
<space>rris wired to:reload.