{"id":26612292,"url":"https://github.com/michaelzheng67/live-vim","last_synced_at":"2026-04-29T06:37:05.369Z","repository":{"id":284049753,"uuid":"953609854","full_name":"michaelzheng67/live-vim","owner":"michaelzheng67","description":"Vim with your friends 📝","archived":false,"fork":false,"pushed_at":"2025-04-07T20:51:40.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T21:42:02.525Z","etag":null,"topics":["cpp","vim"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelzheng67.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-23T18:45:24.000Z","updated_at":"2025-04-07T20:51:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe9b6d83-fd02-4500-8012-39007bb238b8","html_url":"https://github.com/michaelzheng67/live-vim","commit_stats":null,"previous_names":["michaelzheng67/live-vim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaelzheng67/live-vim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelzheng67%2Flive-vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelzheng67%2Flive-vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelzheng67%2Flive-vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelzheng67%2Flive-vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelzheng67","download_url":"https://codeload.github.com/michaelzheng67/live-vim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelzheng67%2Flive-vim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262846341,"owners_count":23373805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","vim"],"created_at":"2025-03-24T03:17:29.780Z","updated_at":"2026-04-29T06:37:00.349Z","avatar_url":"https://github.com/michaelzheng67.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Live Vim 📽️\n\nEdit files with others in real time\n\nLive Vim is a collaborative, terminal-based editor that brings the power of Vim to real-time editing sessions. Whether you're pair programming, running a remote interview, or just want to jam with a friend on code — Live Vim makes it seamless.\n\n## Features 📝\n\n🧑‍💻 Vim-style Editing: Built around familiar normal, insert, and visual modes.  \n🔁 Real-Time Sync: Edits are synchronized across all connected users instantly.  \n🌐 Client-Server Model: One user runs the server, others connect as clients through websockets.  \n📦 Minimal Dependencies: Pure C++ with Boost and ncurses; no frameworks here.  \n📄 File Loading \u0026 Saving: Open local files and write back changes collaboratively.\n\n## Demo\n\nhttps://github.com/user-attachments/assets/7873f2e1-6c36-4c29-a7b5-5d4b4c109b5d\n\n## Collaboration Flow 👥\n\n1. One user runs the server process opened up to a specific file they wish to edit\n2. Others connect to the server process by indicating server IP and port, while also making sure they open the same file\n3. That's it! Everyone can edit and see changes in real-time, like magic ✨\n\n## Architecture\n\nThere are two processes that run when you spin up live vim:\n\n- parent process running ncurses terminal gui\n- child process managing websocket connection\n\nThe main reason for this design is that as of today, ncurses is not thread-safe. Thus, we opt for a multi-process approach to separate concerns and ensure that neither terminal or network ops block each other.\n\nPackets are sent over the wire with a specific structure. Currently, there are two highlighted actions you can take: insertion and deletion. These operations are sent\non each edit and applied to the local copies of the file for each user. Given we are using a websocket connnection with TCP as the underlying network layer, we can\nensure that changes will reach each client at least once due to re-transmissions. Furthermore, websockets are a more \"intuitive\" fit for two-way communication as\nopposed to a request - response based model, and don't require new connections on each transmission (older versions of http) and lower header overhead.\n\nFile content is essentially represented as a vector of strings, indexed by the row they belong to. This helps wit write contention compared to a naive buffer\nimplementation, as edits on two separate rows will not affect each other, and the only contention is per line. On each edit to file content, the vector is shrunk to use\nonly the necessary memory to hold exactly the rows of content present, thus reducing memory footprint.\n\n## Getting Started 🧪\n\n### Requirements\n\nC++17 or greater  \nboost 1.87 or greater  \nncurses 6.5 or greater  \ncmake 3.31.4 or greater\n\nPlaying with the source code:\n\n```\n// clone this repo first\ncd live-vim\nmake // builds the live-vim binary\nmake test // runs unit tests (gtest)\n```\n\nTo compile binary and run in terminal:\n\n```\nchmod +x configure.sh\n./configure.sh // compiles + places binary into usr/local/bin. likely requires sudo\n```\n\nThen you can run live-vim:\n\n```\n(base) MacBook-Pro-4:bin michaelzheng$ live-vim -h\nVim with your friends 📝\n\n\nlive-vim [OPTIONS]\n\n\nOPTIONS:\n  -h,     --help              Print this help message and exit\n...\n```\n\nTo run a docker image:\n\n```\ndocker build -t live-vim-image .\n\n// Then you can run with cli options\n$ docker run -p 8002:8002 live-vim-image ./build/live-vim -h\nVim with your friends 📝\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelzheng67%2Flive-vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelzheng67%2Flive-vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelzheng67%2Flive-vim/lists"}