NeoSvim is a powerful tool that enables you to effortlessly switch between different Neovim configurations. Just like swimming through different pools, NeoSvim lets you dive into and explore various setups without the hassle of manual reconfiguration.
NeoSvim allows you to:
- Switch between different Neovim configurations seamlessly
- Try out different setups without compromising your existing workflow
- Experiment with new plugins and settings in isolated environments
- Share and collaborate on configurations with others
To install NeoSvim:
-
Backup your existing Neovim configuration:
mv ~/.config/nvim ~/.config/nvim.backup # Linux/macOS # or move %LOCALAPPDATA%\nvim %LOCALAPPDATA%\nvim.backup # Windows
-
Clone the NeoSvim repository:
git clone https://github.com/TheLazyCat00/NeoSvim.git ~/.config/nvim # Linux/macOS # or git clone https://github.com/TheLazyCat00/NeoSvim.git %LOCALAPPDATA%\nvim # Windows
-
Launch Neovim and NeoSvim will initialize automatically.
NeoSvim provides three main commands:
-
Switch - Switch to a different Neovim configuration:
:Switch
This will prompt you to enter a Git repository URL containing the configuration you want to switch to.
-
SwitchLogs - View logs of the most recent configuration switch:
:SwitchLogs
This opens a floating window displaying detailed information about the last switch operation.
-
Reload - Reload your current configuration:
:Reload
This reloads the active configuration without restarting Neovim.
Note: Sometimes reloading doesnt work. In this case restart Neovim.
NeoSvim operates through a clever mechanism that manipulates Neovim's configuration path:
- It overrides Neovim's
stdpath()
function to redirect the "config" path to a subdirectory - When you switch configurations, it clones the target Git repository into this subdirectory
- NeoSvim then sources the appropriate initialization files from the new configuration
Note: NeoSvim temporarily changes some Neovim defaults, but they only apply for the current session. So if you don't like NeoSvim, just remove it and get back to your config.
This approach allows you to maintain multiple configurations in isolation, with each having its own plugins, settings, and keymaps - all while keeping your original setup intact if you want to revert back. The name "NeoSvim" represents the fluid nature of swimming (svim) between different Neovim configurations. It offers the freedom to explore and adapt your editor environment to suit different projects or workflows, just like swimming through different waters.
Contributions are welcome! Feel free to submit pull requests or open issues to help improve NeoSvim.