Skip to content

Instantly share code, notes, and snippets.

@mlabrkic
Last active December 21, 2022 09:21
Show Gist options
  • Save mlabrkic/60cfbade29911572af3004287fd7a364 to your computer and use it in GitHub Desktop.
Save mlabrkic/60cfbade29911572af3004287fd7a364 to your computer and use it in GitHub Desktop.
Go to another Neovim configuration
:: nvbat_goto_version_1.bat
:: OS: Windows 10
:: Copy this bat file to folder C:\UTILS\
:: CONS:
:: If you open "init.vim" in an editor, then there will be a mess.
:: Then you need to manually rename the folders.
:: ---------------------------------------------------------
:: Choose the Neovim CONFIG (the configuration changes to another):
:: / stable release or development prerelease (nightly) /
:: Search (open command prompt): Win-S, cmd
:: CD /d C:\UTILS\
:: nvbat_goto_version_1.bat
:: nvim1 (stable)
:: or
:: nvim2 (test)
:: ---------------------------------------------------------
:: Other:
:: https://dev.to/creativenull/installing-neovim-nightly-alongside-stable-10d0
:: ---------------------------------------------------------
:: Windows Command shell info:
:: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands
:: https://ss64.com/nt/
:: /Windows has two command-line shells: the Command shell and PowerShell./
:: http://ss64.com/nt/cd.html
:: https://ss64.com/nt/if.html
:: https://ss64.com/nt/ren.html
:: ---------------------------------------------------------
:: What to do? Where to install Neovim?
:: Instal Neovim (stable) to folder C:\UTILS\Neovim\
:: Note: C:\Users\username\AppData\ , it is a hidden folder
:: 1)
:: First, rename folders (a stable release):
:: C:\UTILS\Neovim\
:: C:\Users\username\AppData\Local\nvim\
:: C:\Users\username\AppData\Local\nvim-data\
:: to
:: C:\UTILS\Neovim1\
:: C:\Users\username\AppData\Local\nvim1\
:: C:\Users\username\AppData\Local\nvim-data1\
:: ---------------------------
:: 2)
:: Second: install Neovim (test) development prerelease (nightly)
:: in this moment - test configuration is active
:: ---------------------------------------------------------
IF EXIST Neovim1 (
:: Currently I use a development (prerelease) build
:: I want to change to a stable release
ren Neovim Neovim2
ren Neovim1 Neovim
) ELSE (
:: Currently I use a stable release,
:: I want to change to development prerelease (nightly)
ren Neovim Neovim1
ren Neovim2 Neovim
)
:: ---------------------------------------------------------
:: CD /d C:\Users\username\AppData\Local\
CD /d %USERPROFILE% "\AppData\Local\"
IF EXIST nvim1 (
:: Currently I use a development (prerelease) build
:: I want to change to a stable release
ren nvim nvim2
ren nvim-data nvim-data2
ren nvim1 nvim
ren nvim-data1 nvim-data
) ELSE (
:: Currently I use a stable release,
:: I want to change to development prerelease (nightly)
ren nvim nvim1
ren nvim-data nvim-data1
ren nvim2 nvim
ren nvim-data2 nvim-data
)
@mlabrkic
Copy link
Author

Before using this script, you should make a backup of the Neovim config folder.

Be sure to "exit" Neovim, and only then run this script!
As I remember, Neovim config folder was deleted a couple of times...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment