Windows Terminal - Choose Neovim "Stable" or "Test" Config
Table of Contents
Neovim Windows Terminal profile with $env:NVIM_APPNAME
To create a dedicated Neovim profile in Windows Terminal that automatically sets the $env:NVIM_APPNAME
environment variable, you should customize your Windows Terminal settings.json
to add a specific profile for Neovim with the appropriate environment variable.
This allows you to launch Neovim with a separate config directory (profile) just by selecting the profile from the Windows Terminal dropdown—ideal for testing configs or keeping different setups isolated.
Neovim (Vim-based text editor): https://neovim.io/
Check in Neovim: :h NVIM_APPNAME
, :echo $NVIM_APPNAME
and :echo stdpath("config")
These are my settings (Windows Terminal): “settings.json”
You need to do this first:
- Copy the Neovim “TEST” configuration to the “nvimt” folder:
C:\Users\<you>\AppData\Local\nvimt
- Then run the Neovim-TEST profile (Ctrl-Shift-2) in the “Windows Terminal”.
These are my folders (stable and test):
C:\Users\<you>\AppData\Local\
nvim
nvim-data
nvimt
nvimt-data
Step-by-Step: Windows Terminal Neovim Profile with $env:NVIM_APPNAME
1. Open Windows Terminal Settings
- Press
Ctrl + ,
or use the dropdown menu (top bar) → Settings. - Alternatively, open the
settings.json
file for advanced editing.
2. Add a New Profile for Neovim
Locate the "profiles"
section and add a new object under "list"
. Here is my profile for Neovim with NVIM_APPNAME
set:
"list":
[
{
"commandline": "\"C:\\UTILS\\Neovim\\bin\\nvim.exe\"",
"environment":
{
"NVIM_APPNAME": "nvim"
},
"font":
{
"face": "SauceCodePro Nerd Font",
"size": 16,
"weight": "medium"
},
"guid": "{85d07d3a-2606-428a-9cf8-16ba4c45c770}",
"hidden": false,
"icon": "C:\\UTILS\\Neovim\\share\\nvim\\runtime\\neovim.ico",
"name": "Neovim-STABLE",
"startingDirectory": "%USERPROFILE%\\Documents"
},
{
"commandline": "\"C:\\UTILS\\Neovim\\bin\\nvim.exe\"",
"environment":
{
"NVIM_APPNAME": "nvimt"
},
"font":
{
"face": "SauceCodePro Nerd Font",
"size": 16,
"weight": "medium"
},
"guid": "{31d2b985-d9d6-4288-b31d-8fd24d6b9bf0}",
"hidden": false,
"icon": "C:\\UTILS\\Neovim\\share\\nvim\\runtime\\neovim.ico",
"name": "Neovim-TEST",
"startingDirectory": "%USERPROFILE%\\Documents",
"tabColor": "#FFFFCC"
},
...
]
- Change
"nvimt"
to whatever profile/directory name you want Neovim to use, e.g.,"astronvim"
,"lazyvim"
, etc. - Adjust
commandline
,icon
,colorScheme
, orfontFace
as needed. environment
is the critical key: it will set the environment variable only for terminals started from this profile.123
I want this: when I start Windows Terminal, it should immediately open Neovim with “Stable” configuration.
I set that up here: Settings, Startup (Default Profile = “Neovim-STABLE”) (Ctrl-Shift-1)
3. Save and Use Your Profile
- Save the edited
settings.json
(the terminal reloads automatically). - Use the down-arrow in Windows Terminal to select your new “Neovim (Custom Profile)” tab.
- Every new tab with this profile will run
nvim
withNVIM_APPNAME
set, making Neovim use the config directory at%LOCALAPPDATA%\<NVIM_APPNAME>
(e.g., for"lvim"
, it usesC:\Users\<you>\AppData\Local\lvim
).456
Key Points
- Isolated configs: Multiple
NVIM_APPNAME
profiles let you isolate configs/plugins/data per Neovim profile. - No scripting needed: The
environment
option in profile config ensures the variable is set just for that profile—no need to editPROFILE
scripts or system-wide variables. - Custom launch: You can have as many Neovim profiles (for different setups) in the Windows Terminal dropdown as you wish; just duplicate and adjust the
environment
variable for each.
Reference Profile Block
{
"guid": "{unique-guid-here}",
"name": "Neovim (Astronvim)",
"commandline": "nvim",
"environment": { "NVIM_APPNAME": "astronvim" }
}
With this Windows Terminal profile setup, simply open a dedicated Neovim tab to use your chosen config profile—fast and easily switchable without manual commandline set
or export
gymnastics.256341