I have installed nvim using scoop on two Windows 11 systems. The installation works fine on my laptop (Surface Laptop 3). On my desktop, when I run git commit
with nvim set as my editor, the terminal (Powershell or cmd) is in black and white (see images below). The problem persists with or without my lua config (which is just bare bones set
ting variables, no plugins).
The only difference between the two machines that I've noticed is that if nvim is run in a terminal normally with nvim
,:echo $TERM
outputs vtpcon
on both machines. However, when nvim is opened with git commit
, :echo $TERM
outputs xterm-256color
on my laptop, and cygwin
on my desktop.
Curiously, setting my git editor to vim
(rather than nvim
) on my desktop and running git commit
opens vim with the correct colours, and :echo $TERM
outputs cygwin
in this window.
I'm very new to (n)vim so I'm not sure how to fix this or what is even wrong. Help?
:echo $TERM
outputs something different on my machines depending on whether I've run nvim normally in the terminal withnvim
, or if it's opened viagit commit
. On both machines, opening it normally withnvim
yields$TERM
asvtpcon
, but when nvim is opened viagit commit
(after setting it as git'score.editor
) on my laptop$TERM
says xterm-256color, and on my desktop it says
cygwin`. I will reword it in the question now.vim --clean
). After that, it could be terminfo-related, but I kind of doubt it since you said Vim with$TERM=cygwin
worked.core.editor
to"nvim -u NONE -U NONE -N"
and similar, butgit commit
still has no syntax highlighting. Debugging only shows the linecmd: augroup nvim_terminal
. I have no plugins, but turning them off with the flag did nothing. I generated full log files for both nvim and vim (i.e. just(n)vim -V9logfile.log
) and the diff turned up no lines. As an aside, I tried installing neovim via winget and that didn't fix anything either.nvim -u NONE -U NONE -N
you might need to do:filetype on
,:syntax enable
,:edit
(I can't recall which if any of those are NeoVim defaults). But the point is that this likely means your config is not the culprit. Could be a bug /shrugvim
works with syntax highlighting. I've wasted enough time researching this problem so I think it's time I move on. Thanks for trying to help. :)