{"id":25170852,"url":"https://github.com/lanjelin/nvim-docker","last_synced_at":"2025-04-03T21:19:31.101Z","repository":{"id":276201541,"uuid":"928293212","full_name":"Lanjelin/nvim-docker","owner":"Lanjelin","description":"Run NeoVim using docker, in your terminal or webbrowser.","archived":false,"fork":false,"pushed_at":"2025-02-20T15:35:08.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T21:47:30.156Z","etag":null,"topics":["astronvim","docker","docker-image","lazyvim","lunarvim","neovim","nvchad","nvim","spacevim"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Lanjelin.png","metadata":{"files":{"readme":".github/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-02-06T11:52:00.000Z","updated_at":"2025-03-02T03:56:27.000Z","dependencies_parsed_at":"2025-02-06T21:31:38.243Z","dependency_job_id":"830ed126-04b0-495a-b458-dcc4998ad136","html_url":"https://github.com/Lanjelin/nvim-docker","commit_stats":null,"previous_names":["lanjelin/nvim-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lanjelin%2Fnvim-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lanjelin%2Fnvim-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lanjelin%2Fnvim-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lanjelin%2Fnvim-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lanjelin","download_url":"https://codeload.github.com/Lanjelin/nvim-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247078855,"owners_count":20879953,"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":["astronvim","docker","docker-image","lazyvim","lunarvim","neovim","nvchad","nvim","spacevim"],"created_at":"2025-02-09T09:16:51.812Z","updated_at":"2025-04-03T21:19:31.093Z","avatar_url":"https://github.com/Lanjelin.png","language":"Shell","readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png\"\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003envim-docker\u003c/h1\u003e\n\nRun [Neovim](https://neovim.io/) using Docker—directly in your terminal or in your browser using [ttyd](https://github.com/tsl0922/ttyd).\n\nThis image is based on [Arch Linux](https://hub.docker.com/_/archlinux) and includes:\n- [Zsh](https://www.zsh.org/) with [Oh My Zsh](https://ohmyz.sh/)\n- [ttyd](https://github.com/tsl0922/ttyd) for web-based access, [built with NerdFont](https://github.com/lanjelin/nerd-ttyd)\n- Easy first-run setup for popular Neovim distros\n\n## Why Use nvim-docker?\n- **No system dependencies**: Run Neovim without installing anything except Docker.\n- **Supports most LSPs, DAPs, linters, and formatters**.\n- **Built for UnRaid, but works on other Linux-based systems**.\n- **Slim version available**: Use `ghcr.io/lanjelin/nvim-docker:slim` for a smaller image.\n\n---\n\n## 🚀 Installation\n\nTo persist your Neovim configuration, mount `/root` to a volume or a folder on the host.\n\n### 🛠 Supported Neovim Distros\n\nYou can specify the `NVIM_DISTRO` environment variable on first run to install one of the following:\n- [LazyVim](https://www.lazyvim.org/)\n- [AstroNvim](https://astronvim.com/)\n- [NvChad](https://nvchad.com/)\n- [LunarVim](https://www.lunarvim.org/)\n- [SpaceVim](https://spacevim.org/)\n- [Kickstart](https://github.com/nvim-lua/kickstart.nvim)\n- [NormalNvim](https://normalnvim.github.io/)\n\nIf `.config/nvim` exists, no changes will be made.  \nWant another distro? Open an issue or pull request!\n\n---\n\n## ▶️ First Run\n\nThe container installs **Oh My Zsh** and your chosen Neovim distro on first launch.  \nTo initialize the setup, run:\n\n```bash\ndocker run -it --rm \\\n  -v /mnt/user/appdata/nvim-docker:/root \\\n  -e NVIM_DISTRO=\"lazyvim\" \\\n  ghcr.io/lanjelin/nvim-docker:latest\n```\n\n---\n\n## 🖥 CLI Usage\n\nTo integrate `nvim-docker` as your `nvim` command, add this function to your `.bashrc` or `.zshrc`:\n\n```bash\nnvim () {\n  if [ ! $# -eq 0 ]; then\n    [[ -d \"$1\" ]] || [[ -f \"$1\" ]] || touch \"$1\"\n    [[ -f \"$1\" ]] \u0026\u0026 NWD=\"$(dirname $1)\" || NWD=\"$(realpath $1)\"\n    docker run -it --rm --name nvim-docker-cli \\\n    -w \"/edit$NWD\" \\\n    -v \"$(realpath $1)\":\"/edit$(realpath $1)\" \\\n    -v /mnt/user/appdata/nvim-docker:/root \\\n    ghcr.io/lanjelin/nvim-docker:latest \\\n    nvim \"/edit$(realpath $1)\"\n  else\n    docker run -it --rm --name nvim-docker-cli \\\n    -w \"/root\" \\\n    -v /mnt/user/appdata/nvim-docker:/root \\\n    ghcr.io/lanjelin/nvim-docker:latest \\\n    nvim\n  fi\n}\n```\nAfter adding this, reload your shell:\n```bash\nsource ~/.zshrc  # or `source ~/.bashrc`\n```\n\nOr add this function to your `~/.config/fish/config.fish`:\n```fish\nfunction nvim\n    if set -q argv[1]\n        test -d \"$argv[1]\" || test -f \"$argv[1]\" || touch \"$argv[1]\"\n        test -f \"$argv[1]\" \u0026\u0026 set NWD \"$(dirname $argv[1])\" || set NWD \"$(realpath $argv[1])\"\n        docker run -it --rm --name nvim-docker-cli \\\n        -w \"/edit$NWD\" \\\n        -v \"$(realpath $argv[1])\":\"/edit$(realpath $argv[1])\" \\\n        -v /mnt/user/appdata/nvim-docker:/root \\\n        ghcr.io/lanjelin/nvim-docker:latest \\\n        nvim \"/edit$(realpath $argv[1])\"\n    else\n        docker run -it --rm --name nvim-docker-cli \\\n        -w \"/root\" \\\n        -v /mnt/user/appdata/nvim-docker:/root \\\n        ghcr.io/lanjelin/nvim-docker:latest \\\n        nvim\n    end\nend\n```\nAfter adding this, reload your shell:\n```fish\nsource ~/.config/fish/config.fish\n```\n\n---\n\n## 🛠 UnRaid Setup\n\nIf you've followed my guide for [ZSH and Oh-My-Zsh with persistent history](https://github.com/Lanjelin/unraid/tree/main/zsh-omz-persistent#zsh-and-oh-my-zsh-with-persistent-history), adding the above would work seamlessly. If not, there are a few ways to make this work.\n\n### Preferred Method (User Scripts)\n\n1. Download the function file:\n```bash\nwget -O /mnt/user/appdata/nvim-docker/.nvim-docker.rc https://raw.githubusercontent.com/Lanjelin/nvim-docker/main/.nvim-docker.rc\n```\n2. Create a new user script in UnRaid's User Scripts plugin.\n3. Set it to **\"At First Array Start Only\"** and paste:\n```bash\ncat /mnt/user/appdata/nvim-docker/.nvim-docker.rc \u003e\u003e /root/.bash_profile\n```\n\n### Alternative Method (Boot-time Setup)\n\nThis will result in errors if you try to run `nvim` before the array is started.\n\n1. Download the file:\n```bash\nwget -O /boot/config/.nvim-docker.rc https://raw.githubusercontent.com/Lanjelin/nvim-docker/main/.nvim-docker.rc\n```\n2. Modify the `go` file to load it on boot:\n```bash\necho \"cat /boot/config/.nvim-docker.rc \u003e\u003e /root/.bash_profile\" \u003e\u003e /boot/config/go\n```\n\n---\n\n## 🌐 Running Neovim in the Browser\n\nThis image includes **ttyd**, allowing you to run Neovim (or Zsh) in a web browser.\n\n### UnRaid template\n\nTo quickly add this in UnRaid:\n```bash\nwget -O /boot/config/plugins/dockerMan/templates-user/my-nvim-docker.xml \\\nhttps://raw.githubusercontent.com/Lanjelin/docker-templates/main/lanjelin/nvim-docker.xml\n```\nThen go to **Docker → Add Container**, select `nvim-docker` from the **Template dropdown**.\n\n### Docker\n```bash\ndocker run -d --name nvim-docker \\\n  -w \"/edit\" \\\n  -p 7681:7681 \\\n  -v /path/to/project:/edit \\\n  -v /mnt/user/appdata/nvim-docker:/root \\\n  ghcr.io/lanjelin/nvim-docker:latest \\\n  ttyd.nerd -W -t fontFamily=\"JetBrains\" nvim \"/edit\"\n```\n### Docker Compose\n```yaml\nservices:\n  nvim-docker:\n    container_name: nvim-docker\n    working_dir: /edit\n    ports:\n      - 7681:7681\n    volumes:\n      - /path/to/project:/edit\n      - /mnt/user/appdata/nvim-docker:/root\n    image: ghcr.io/lanjelin/nvim-docker:latest\n    command: ttyd.nerd -W -t fontFamily=\"JetBrains\" nvim \"/edit\"\n```\n\n### Zsh in the browser\nFor full shell access instead of Neovim:\n```bash\ndocker run -d --name nvim-docker \\\n  -w \"/edit\" \\\n  -p 7681:7681 \\\n  -v /path/to/project:/edit \\\n  -v /mnt/user/appdata/nvim-docker:/root \\\n  ghcr.io/lanjelin/nvim-docker:latest \\\n  ttyd.nerd -W -t fontFamily=\"JetBrains\" zsh\n```\n\n---\n\n## 🔒 Security Considerations\n\nThis container runs as **root**, allowing it to modify files and directories it accesses.  \nFor security:\n- **Do not expose it to the internet** without proper precautions.\n- Consider running it in an isolated network.\n\n---\n\n## 📢 Contributions \u0026 Feedback\n\nWant a feature or another Neovim distro?  \nFeel free to open an [issue](https://github.com/Lanjelin/nvim-docker/issues) or submit a pull request!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanjelin%2Fnvim-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanjelin%2Fnvim-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanjelin%2Fnvim-docker/lists"}