{"id":16124583,"url":"https://github.com/ahdinosaur/nvimd","last_synced_at":"2025-09-20T13:31:21.243Z","repository":{"id":190556078,"uuid":"682586415","full_name":"ahdinosaur/nvimd","owner":"ahdinosaur","description":"For new-age neovim users with an antiquated dev style 🤷","archived":false,"fork":false,"pushed_at":"2023-10-25T01:46:52.000Z","size":13,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T06:35:16.881Z","etag":null,"topics":["daemon","headless","neovim","server","vim"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahdinosaur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-08-24T13:43:27.000Z","updated_at":"2025-01-02T11:58:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"d8f1afdb-de92-4574-932f-9fdb3c063f18","html_url":"https://github.com/ahdinosaur/nvimd","commit_stats":null,"previous_names":["ahdinosaur/nvimd"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fnvimd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fnvimd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fnvimd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fnvimd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahdinosaur","download_url":"https://codeload.github.com/ahdinosaur/nvimd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233575917,"owners_count":18696694,"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":["daemon","headless","neovim","server","vim"],"created_at":"2024-10-09T21:21:36.042Z","updated_at":"2025-09-20T13:31:15.977Z","avatar_url":"https://github.com/ahdinosaur.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nvimd\n\nFor new-age `neovim` users with an antiquated dev style:\n\n- Open a terminal\n- From the terminal, open a file with `vim`\n- Edit the file, do dah doo\n- Close `vim`, go back to terminal\n- Open the next file in `vim`\n- Rinse repeat\n\n`nvimd` helps you do this with a long-running `neovim` server, so you don't\nhave to wait for the LSP to boot up each time.\n\nThis is easier than changing how I use `vim`, maybe one day I'll learn. 🤷\n\n## Install\n\n### `nvimd` and `nvimd-server`\n\n#### Http\n\nManually download [`nvimd`](https://github.com/ahdinosaur/nvimd/blob/main/nvimd)\nand\n[`nvimd-server`](https://github.com/ahdinosaur/nvimd/blob/main/nvimd-server)\ninto your preferred `bin` location (e.g. `$HOME/.local/bin`).\n\n#### Git\n\n```shell\ngit clone https://github.com/ahdinosaur/nvimd\ncd nvimd\n./install.sh\n```\n\nThis will install `nvimd` and `nvimd-server` to `$HOME/.local/bin` as symlinks\nback to the `ahdinosaur/nvimd` git repo.\n\n### Neovim config\n\nSince `:q` will close the remote server, we need a special way to exit the\nremote ui.\n\nAdd the following to your Lua `neovim` config\n\n```lua\n-- disconnect all sessions\nvim.keymap.set(\"n\", \"\u003cleader\u003eq\", function()\n  for _, ui in pairs(vim.api.nvim_list_uis()) do\n    -- is remote ui\n    if ui.chan then\n      vim.fn.chanclose(ui.chan)\n    end\n    -- is normal ui\n    if ui.stdout_tty then\n      vim.api.nvim_command(\":q\")\n    end\n  end\nend, { noremap = true })\n```\n\n- [`neovim/neovim`#23093](https://github.com/neovim/neovim/issues/23093)\n\n## Usage\n\nWhen you start working on a project, in your project's root directory:\n\n```shell\nnvimd-server \u0026\n```\n\nThen use `nvimd` as you would `nvim`:\n\n```shell\nnvimd path/to/file\n```\n\nWhen you want to close your editor, use your special keymap (`\u003cleader\u003eq`)\ninstead of `:q`.\n\n## FAQ\n\n### Why?\n\nYes.\n\n### How does this work?\n\nWe use the output of `tty` and `pwd` to construct a socket path.\n\nBecause [`neovim`'s server is not multi-tenant](https://github.com/neovim/neovim/issues/2161),\nwe need a separate server for each terminal (`tty`).\n\nAlso for the sake of plugins working as expected, we want a separate\nserver for each working directory (`pwd`)\n\nWhen you run `nvimd-server`:\n\n- Start a `nvim` server with the given socket path.\n- In case this `nvim` server is shut down, restart in an infinite loop.\n- If we get a signal to close this program, clean up the socket before exiting.\n\nWe need to start `nvimd-server \u0026` in the terminal separately, so the terminal\nis the parent, and when the terminal is closed, the server is closed.\n\nWhen you run `nvimd`:\n\n- Check if there is the socket exists\n- If so, connect to the `nvim` server as a remote ui\n- Otherwise, run `nvim` as usual\n\n### Why does `nvimd-server` need to be started separately?\n\nI was hoping `nvimd` could be used as a drop-in replacement for `nvim`.\n\nIf `nvimd-server` wasn't yet running, then run it when you call `nvimd` the\nfirst time.\n\nBut I couldn't solve this issue:\n\n- If `nvimd` starts `nvimd-server`, then `nvimd-server`'s parent process is\n  `nvimd`.\n- When that `nvimd` process eventually stops (because you're done editing your\n  file), then `nvimd-server` has no parent and is re-parented to PID 1 (`init`).\n- When you later are done and close your terminal, `nvimd-server` keeps running.\n\nI think a proper solution would be something\n[like how `screen` works](https://unix.stackexchange.com/a/193918).\n\n## [License](./LICENSE)\n\n```txt\nCopyright 2023 Michael Williams\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahdinosaur%2Fnvimd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahdinosaur%2Fnvimd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahdinosaur%2Fnvimd/lists"}