{"id":26351251,"url":"https://github.com/y3owk1n/nvs","last_synced_at":"2025-06-13T17:06:41.771Z","repository":{"id":280935286,"uuid":"943658881","full_name":"y3owk1n/nvs","owner":"y3owk1n","description":"A lightweight Neovim Version \u0026 Config Manager CLI tool to install, switch, list, uninstall, and reset Neovim versions.","archived":false,"fork":false,"pushed_at":"2025-05-18T06:36:32.000Z","size":310,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T18:54:05.168Z","etag":null,"topics":["cli","command-line","command-line-tool","golang","neovim","neovim-configuration-manager","neovim-version-manager","version-manager"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/y3owk1n.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-03-06T04:07:18.000Z","updated_at":"2025-05-18T08:19:57.000Z","dependencies_parsed_at":"2025-06-13T17:02:57.097Z","dependency_job_id":null,"html_url":"https://github.com/y3owk1n/nvs","commit_stats":null,"previous_names":["y3owk1n/nvsw","y3owk1n/nvs"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/y3owk1n/nvs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y3owk1n%2Fnvs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y3owk1n%2Fnvs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y3owk1n%2Fnvs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y3owk1n%2Fnvs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y3owk1n","download_url":"https://codeload.github.com/y3owk1n/nvs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y3owk1n%2Fnvs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259686085,"owners_count":22896049,"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":["cli","command-line","command-line-tool","golang","neovim","neovim-configuration-manager","neovim-version-manager","version-manager"],"created_at":"2025-03-16T10:20:43.238Z","updated_at":"2025-06-13T17:06:41.748Z","avatar_url":"https://github.com/y3owk1n.png","language":"Go","funding_links":[],"categories":["External"],"sub_categories":["Version Manager"],"readme":"# nvs (Neovim Version Switcher)\n\n**Neovim Version Switcher** – Easily install, switch, and manage multiple versions (including commit hashes) and config of Neovim like a boss 🚀\n\n[![CI](https://github.com/y3owk1n/nvs/actions/workflows/ci.yml/badge.svg)](https://github.com/y3owk1n/nvs/actions/workflows/ci.yml) [![GitHub release](https://img.shields.io/github/release/y3owk1n/nvs.svg)](https://github.com/y3owk1n/nvs/releases) [![License](https://img.shields.io/github/license/y3owk1n/nvs.svg)](LICENSE)\n\n## 👀 Overview\n\n**nvs** (Neovim Version Switcher/Manager) is a lightweight cross-platform CLI tool written in Go 🏗️ that makes it super easy to install, switch between, and manage multiple versions of Neovim and config on your machine. Whether you’re testing a cutting‑edge nightly build 🌙 or sticking with the stable release 🔒, **nvs** has got your back!\n\n```bash\n$ nvs use stable\n✓ Switched to Neovim stable\n\n$ nvim -v\nNVIM v0.10.4\nBuild type: Release\nLuaJIT 2.1.1713484068\nRun \"nvim -V1 -v\" for more info\n\n$ nvs use nightly\n✓ Switched to Neovim nightly\n\n$ nvim -v\nNVIM v0.11.0-dev-1961+g7e2b75760f\nBuild type: RelWithDebInfo\nLuaJIT 2.1.1741571767\nRun \"nvim -V1 -v\" for more info\n\n$ nvs install 0.10.0\nℹ Resolving version v0.10.0...\nℹ Installing Neovim v0.10.0...\n✓ Installation successful!\n\n$ nvs use 0.10.0\n✓ Switched to Neovim v0.10.0\n\n$ nvim -v\nNVIM v0.10.0\nBuild type: Release\nLuaJIT 2.1.1713484068\nRun \"nvim -V1 -v\" for more info\n```\n\n## 🌟 Showcase\n\n\u003chttps://github.com/user-attachments/assets/54f30265-3502-4469-bf5b-f405899e602b\u003e\n\n## 🌟 Features\n\n- **Easy Installation:**\n  Download and install Neovim versions directly from GitHub with a single command.\n- **Version Switching:**\n  Switch between installed versions in a snap. **nvs** updates a global symlink so your preferred version is always just a command away.\n- **Config Switching:**\n  Easily toggle between Neovim configurations by scanning `~/.config` (including symlinks) and setting `NVIM_APPNAME` interactively or via a direct subcommand argument.\n- **Remote Version Listing:**\n  List all available remote releases (stable, nightly, etc.) with cached results to avoid GitHub rate limits ⚡. Need fresh data? Just add the `force` flag.\n- **Upgrade for Stable and Nightly:**\n  Easily upgrade your installed stable and/or nightly versions. The upgrade command checks if you’re already on the latest version and only performs an upgrade if needed.\n- **Uninstallation \u0026 Reset:**\n  Remove individual versions or reset your entire configuration with ease.\n- **Cross-Platform:**\n  Works on macOS (Intel \u0026 Apple Silicon), Linux, and Windows.\n- **Verbose Logging:**\n  Run with the `--verbose` flag to see detailed logs during directory initialization, reset, and other operations.\n\n## 🚀 Installation\n\n\u003e [!warning]\n\u003e To make the process butter smooth, remember to remove any `Neovim` installation in your system and let **nvs** manage them instead.\n\n### Using our install script\n\nYou can install **nvs** with a single command that downloads and executes our [installation script](https://github.com/y3owk1n/nvs/blob/main/install.sh). The script automatically detects your operating system and architecture and installs the appropriate binary.\n\n\u003e [!warning]\n\u003e Always review remote scripts before execution. Before running any script from the internet, inspect its contents to ensure its safety.\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/y3owk1n/nvs/main/install.sh | bash\n```\n\n\u003e [!note]\n\u003e You can upgrade by just running the same installation script again.\n\nWe have also included an `uninstall script` if you would like to uninstall it\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/y3owk1n/nvs/main/uninstall.sh | bash\n```\n\n### Homebrew\n\nInstall **nvs** via Homebrew! Simply add our tap:\n\n```bash\nbrew tap y3owk1n/tap\n```\n\nThen install with:\n\n```bash\nbrew install y3owk1n/tap/nvs\n```\n\n### Using a released binary\n\n- Download the [latest release binary](https://github.com/y3owk1n/nvs/releases) for your system\n- Make it available globally on PATH environment variable\n- Run it like any other method\n\n### Building From Source\n\nMake sure you have [Go](https://golang.org/dl/) (v1.23 or later) installed. Then run:\n\n```bash\ngit clone https://github.com/y3owk1n/nvs.git\ncd nvs\nmkdir -p build\n\n# Build for darwin-arm64\nenv GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/y3owk1n/nvs/cmd.Version=local-build\" -trimpath -o ./build/nvs-darwin-arm64 ./main.go\n\n# Build for darwin-amd64\nenv GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/y3owk1n/nvs/cmd.Version=local-build\" -trimpath -o ./build/nvs-darwin-amd64 ./main.go\n\n# Build for linux-arm64\nenv GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/y3owk1n/nvs/cmd.Version=local-build\" -trimpath -o ./build/nvs-linux-arm64 ./main.go\n\n# Build for linux-amd64\nenv GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/y3owk1n/nvs/cmd.Version=local-build\" -trimpath -o ./build/nvs-linux-amd64 ./main.go\n\n# Build for windows-amd64\nenv GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/y3owk1n/nvs/cmd.Version=local-build\" -trimpath -o ./build/nvs-windows64.exe ./main.go\n````\n\nMove the binary to your PATH or run it directly.\n\n## 📂 Configuration \u0026 Data\n\n**nvs** now follows OS-specific best practices for storing configuration, cache, and binary data. By default:\n\n- **Configuration Files:**\n  Stored in `~/.config/nvs` on Unix-like systems (or `%APPDATA%\\nvs` on Windows).\n  Override with the `NVS_CONFIG_DIR` environment variable.\n- **Cache Files:**\n  Stored in `~/.cache/nvs` on Unix-like systems (or `%LOCALAPPDATA%\\nvs\\Cache` on Windows).\n  Override with the NVS_CACHE_DIR environment variable.\n- **Global Binary Symlinks:**\n  Placed in `~/.local/bin` on Unix-like systems (or an equivalent directory on Windows).\n  Override with the `NVS_BIN_DIR` environment variable.\n\n\u003e [!note]\n\u003e All these directories will be created upon running any command (including `nvs --help`) the first time after installation.\n\u003e If you set custom paths after that, feel free to manually delete the default directories.\n\n### Overriding Default Directories with Environment Variables\n\n**nvs** allows you to customize the locations where configuration, cache, and binary files are stored by setting the following environment variables:\n\n- `NVS_CONFIG_DIR` Overrides the default configuration directory.\n  - Default:\n    - On Unix-like systems: `~/.config/nvs`\n    - On Windows: `%APPDATA%\\nvs`\n- `NVS_CACHE_DIR` Overrides the default cache directory.\n  - Default:\n    - On Unix-like systems: `~/.cache/nvs`\n    - On Windows: `%LOCALAPPDATA%\\nvs\\Cache`\n- `NVS_BIN_DIR` Overrides the default global binary directory.\n  - Default:\n    - On Unix-like systems: `~/.local/bin`\n    - On Windows: `%APPDATA%\\nvs\\bin`\n\n#### How to Set These Environment Variables\n\n##### On Unix-like Systems (Linux/macOS)\n\nYou can add the following lines to your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`):\n\n```bash\n# Override nvs directories\nexport NVS_CONFIG_DIR=\"$HOME/custom-config/nvs\"\nexport NVS_CACHE_DIR=\"$HOME/custom-cache/nvs\"\nexport NVS_BIN_DIR=\"$HOME/custom-bin\"\n```\n\nAfter editing your configuration file, reload it:\n\n```bash\nsource ~/.bashrc   # or source ~/.zshrc\n```\n\n##### On Windows\n\nYou can set environment variables temporarily in the Command Prompt:\n\n```bash\nset NVS_CONFIG_DIR=C:\\Path\\To\\Custom\\Config\nset NVS_CACHE_DIR=C:\\Path\\To\\Custom\\Cache\nset NVS_BIN_DIR=C:\\Path\\To\\Custom\\Bin\n```\n\nFor a permanent change, open the **System Properties** → **Advanced** → **Environment Variables** and add or edit the variables there. Alternatively, you can use the `setx` command in an elevated Command Prompt:\n\n```bash\nsetx NVS_CONFIG_DIR \"C:\\Path\\To\\Custom\\Config\"\nsetx NVS_CACHE_DIR \"C:\\Path\\To\\Custom\\Cache\"\nsetx NVS_BIN_DIR \"C:\\Path\\To\\Custom\\Bin\"\n```\n\n\u003e [!note]\n\u003e If you override the binary directory (`NVS_BIN_DIR`), make sure to update your system's PATH variable accordingly so that the **nvs** binaries can be found by your shell.\n\n## 💻 Usage\n\n**nvs** uses a clean subcommand interface. Run `nvs --help` for full details.\n\n### Commands\n\n```bash\nA CLI tool to install, switch, list, uninstall, and reset Neovim versions.\n\nUsage:\n  nvs [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  config      Switch Neovim configuration\n  current     Show current active version with details\n  env         Print NVS env configurations\n  help        Help about any command\n  install     Install a Neovim version or commit\n  list        List installed versions\n  list-remote List available remote versions with installation status (cached for 5 minutes or force)\n  path        Automatically add the global binary directory to your PATH\n  reset       Reset all data (remove symlinks, downloaded versions, cache, etc.)\n  uninstall   Uninstall a specific version\n  upgrade     Upgrade installed stable and/or nightly versions\n  use         Switch to a specific version or commit hash\n\nFlags:\n  -h, --help      help for nvs\n  -v, --verbose   Enable verbose logging\n      --version   version for nvs\n\nUse \"nvs [command] --help\" for more information about a command.\n```\n\n#### list-remote\n\nList available remote releases and installed status (cached for 5 minutes to avoid rate limiting). Use the force flag to refresh the cache.\n\n\u003e [!note]\n\u003e The list will be filtered out for only nightly, stable, and all version that are above v0.5.0.\n\n```bash\nnvs list-remote\nnvs list-remote force # force refresh the cache\n\n# or with shorthand\nnvs ls-remote\nnvs ls-remote force\n```\n\n#### list\n\nList all locally installed Neovim versions\n\n```bash\nnvs list\n\n# or with shorthand\nnvs ls\n```\n\n#### install\n\nInstall a specific Neovim version or build from commits.\n\n\u003e [!warning]\n\u003e To build from commit, make sure your system has `git`, `make`, and `cmake` installed, as building Neovim requires these 3 pieces to work together.\n\n\u003e [!warning]\n\u003e If you're using macos make sure to also run `brew install ninja cmake gettext curl`.\n\n```bash\nnvs install stable    # Install the latest stable release 🔒\nnvs install nightly   # Install the latest nightly release 🌙\nnvs install v0.10.3   # Install a specific version\nnvs install 0.10.3    # Or without the v keyword\nnvs install master    # Build and install based on the latest master commit\nnvs install 2db1ae3   # Build and install a specific commit hash in 7 character\nnvs install 2db1ae37f14d71d1391110fe18709329263c77c9 # Or a 40 character hash\n\n# or with shorthand\nnvs i stable\n```\n\n#### use\n\nSwitch to a particular version. This updates a global symlink in your designated bin directory so that you can simply run nvim.\n\n\u003e [!note]\n\u003e **nvs** will attempt to install the version specified if it's not installed and switch to it later.\n\n```bash\nnvs use stable\nnvs use nightly\nnvs use v0.10.3\nnvs use 0.10.3\nnvs use 2db1ae3\n```\n\n\u003e [!warning]\n\u003e If you're using windows, I think you will need `administrator` privilege terminal for **nvs** to symlink.\n\n#### current\n\nDisplay the currently active Neovim version.\n\n```bash\nnvs current\n```\n\n#### upgrade\n\nUpgrade installed stable and/or nightly versions. If no argument is provided, both stable and nightly are upgraded (if installed).\n\n\u003e [!note]\n\u003e The upgrade command checks if the installed release is already up-to-date by comparing a stored identifier (release tag for stable, commit hash or published date for nightly). If no upgrade is needed, you'll be informed that you're on the latest version.\n\n```bash\nnvs upgrade         # Upgrades both stable and nightly if installed\nnvs upgrade stable  # Upgrades only the stable release if installed\nnvs upgrade nightly # Upgrades only the nightly release if installed\n\n# or with shorthand\nnvs up\nnvs up stable\nnvs up nightly\n```\n\n#### config\n\nSwitch between multiple configs. If no argument is provided, it will promp a select UI, else it will just open with specified name.\n\n\u003e [!note]\n\u003e **nvs** scans your configuration directory (e.g. `~/.config`) for entries containing `nvim` in the name. Examples includes `nvim`, `nvim-test`, or `nvim-vanilla`.\n\n```bash\nnvs config\nnvs config nvim-test\n\n# or with shorthand\nnvs c\nnvs conf\n```\n\n#### uninstall\n\nUninstall an installed version. **nvs** will prompt a confirmation `y/N` if trying to uninstall the current used version and also prompt to select one of installed versions and switch to it.\n\n```bash\nnvs uninstall stable\nnvs uninstall nightly\nnvs uninstall v0.10.3\nnvs uninstall 0.10.3\nnvs uninstall 2db1ae3\n\n# or with shorthand\nnvs rm stable\nnvs remove nightly\nnvs un 0.10.3\n```\n\n#### path\n\nBest effort to automatically add the global binary directory to your PATH.\n\n```bash\nnvs path\n```\n\n\u003e [!note]\n\u003e This won't work if you're managing your system with nix home manager. [See details below how to configure it](#nix-home-manager)\n\n#### env\n\nPrints the env configuration used by NVS (`NVS_CONFIG_DIR`, `NVS_CACHE_DIR`, and `NVS_BIN_DIR`).\n\n```bash\nnvs env\n```\n\n#### reset\n\nReset to factory state.\n\n\u003e [!warning]\n\u003e This command will delete all data in your configuration and cache directories—determined based on OS conventions or the environment variables (`NVS_CONFIG_DIR` and `NVS_CACHE_DIR`)—and remove the `nvim` binary from your binary directory (or `NVS_BIN_DIR`). Use with caution.\n\n```bash\nnvs reset\n```\n\n## 🔗 Adding **nvs** to Your PATH\n\nTo easily run the Neovim binary provided by nvs, you need to add the global binary directory to your PATH. By default, this is set according to OS best practices and environment variables. On Unix-like systems, the default is:\n\n- **Configuration Directory:** `~/.config/nvs` (or overridden via `NVS_CONFIG_DIR`)\n- **Cache Directory:** `~/.cache/nvs` (or overridden via `NVS_CACHE_DIR`)\n- **Global Binary Directory:** `~/.local/bin` (or overridden via `NVS_BIN_DIR`)\n\n\u003e [!note]\n\u003e We have provided `nvs path` command for the best effort to automatically setup the path for you in common shells. If it does not work, you need to set it up manually. See below with some example.\n\n### Macos Or Linux\n\n#### Bash\n\nAdd the following line to your `~/.bashrc` (or `~/.bash_profile` on macOS):\n\n```bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\nThen, reload your configuration:\n\n```bash\nsource ~/.bashrc   # or source ~/.bash_profile\n```\n\n#### Zsh\n\nAdd the following line to your `~/.zshrc`:\n\n```bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\nThen, reload your configuration:\n\n```bash\nsource ~/.zshrc\n```\n\n#### Fish\n\nAdd the following line to your `~/.config/fish/config.fish`:\n\n```bash\nset -gx PATH $HOME/.local/bin $PATH\n```\n\nThen, reload your configuration:\n\n```bash\nsource ~/.config/fish/config.fish\n```\n\n### Windows\n\nOpen an elevated Command Prompt (Run as administrator) and type:\n\n```bash\nsetx PATH \"%PATH%;%APPDATA%\\nvs\\bin\"\n```\n\nRestart your Command Prompt (or log off and back on) for the changes to take effect.\n\n\u003e [!note]\n\u003e If you have overridden the default binary directory with the `NVS_BIN_DIR` environment variable, make sure to replace `%APPDATA%\\nvs\\bin` with your custom path in the above command.\n\n### Nix Home Manager\n\nIf you're using home manager with nix, you can try the following as documented at [Nix Home Manager Docs](https://nix-community.github.io/home-manager/options.xhtml#opt-home.sessionPath) :\n\n```nix\n\n{\n home.sessionPath = [\n  \"$HOME/.local/bin\"\n ];\n}\n```\n\n## 🧩 Shell Completions\n\n**nvs** supports generating shell completions using Cobra’s built‐in functionality. You can easily enable command completions for your favorite shell by following the instructions below.\n\n```bash\nGenerate the autocompletion script for nvs for the specified shell.\nSee each sub-command's help for details on how to use the generated script.\n\nUsage:\n  nvs completion [command]\n\nAvailable Commands:\n  bash        Generate the autocompletion script for bash\n  fish        Generate the autocompletion script for fish\n  powershell  Generate the autocompletion script for powershell\n  zsh         Generate the autocompletion script for zsh\n```\n\n### Bash\n\nTo enable Bash completions, add the following line to your `~/.bashrc` (or `~/.bash_profile` on macOS):\n\n```bash\nsource \u003c(nvs completion bash)\n```\n\nThen, reload your configuration:\n\n```bash\nsource ~/.bashrc   # or source ~/.bash_profile\n```\n\n### Zsh\n\nFor Zsh users, first ensure that completion is enabled by adding the following to your ~/.zshrc (if not already present):\n\n```bash\nautoload -U compinit \u0026\u0026 compinit\n```\n\nThen add the following line to generate and load **nvs** completions:\n\n```bash\nsource \u003c(nvs completion zsh)\n```\n\nThen, reload your configuration:\n\n```bash\nsource ~/.zshrc\n```\n\n### Fish\n\nFish shell users can generate completions with:\n\n```bash\nnvs completion fish | source\n```\n\nTo make the completions permanent, save them to your completions directory:\n\n```bash\nnvs completion fish \u003e ~/.config/fish/completions/nvs.fish\n```\n\nThen, reload your configuration:\n\n```bash\nsource ~/.config/fish/config.fish\n```\n\n## 🤝 Contributing\n\nContributions are always welcome! Here's how you can help:\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to your branch\n5. Open a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License. Feel free to use, modify, and distribute it as you see fit.\n\nEnjoy using **nvs**, and may your Neovim sessions be ever lit! ✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy3owk1n%2Fnvs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy3owk1n%2Fnvs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy3owk1n%2Fnvs/lists"}