3

I am using git 2.7.0.windows.1 in Windows 10, with core.editor set to vim.

Vim was downloaded from vim.org latest version binary: VIM - Vi IMproved 7.4.1023 (2013 Aug 10, compiled Jan 2 2016 14:24:35) MS-Windows 32-bit console version

When I do a git commit in a cmd window, it goes into a vim right in the command window. And there is no text shown or maybe black text.

Here is a link to an album with detailed description on the behaviors of the bug.

black text on black screen

I do have syntax on setting in my .vimrc. When I type in command :syntax off the text shows up but goes away if I move the cursor.

Here is my .vimrc file:

" color scheme and syntax highlighting
syntax on
colorscheme industry

" line number
set number

" tab settings
set softtabstop=2 shiftwidth=2 expandtab

" set initial window size
set lines=30 columns=80

" set to auto write buffer before hidden
set autowrite

" set font
if has("gui_running")
  if has("gui_gtk2")
    set guifont=Inconsolata\ 12
  elseif has("gui_macvim")
    set guifont=Menlo\ Regular:h14
  elseif has("gui_win32")
    set guifont=Consolas:h11:cANSI
  endif
endif

" turn on spell check
set spell spelllang=en_us
set spellfile=$HOME/Dropbox/vim/spell/en.utf-8.add

I tried to remove the two lines below which made it worse.

colorscheme industry
syntax on

Now the screen is totally black and does not even responding to :q correctly.

"/e/java-projects/test/.git/COMMIT_EDITMSG" [converted][unix] 16L, 310C

I am doubting it might be some communication bug between git, Windows command line, and vim. I do have a work around: use gvim or use git bash instead, neither have the black text problem.

How can I correct this?

  • Do you have any plugins installed? – SibiCoder Jul 11 '16 at 18:33
  • 1
    You could try putting colorscheme desert in your vimrc to see if that helps. – Tumbler41 Jul 11 '16 at 18:35
  • Could you post your .vimrc? I'm guessing it's most likely a colorscheme issue. What happens if you launch vim with vim -u NONE? – DJMcMayhem Jul 11 '16 at 18:46
  • 1
    Since I can start vim just fine from the command line, this bug should be on the git side. I have filed a bug report to git mailing list and let's hope we can get a fix. I will update here if we can get a fix. As I mentioned above, right now I am using gvim or git bash here as a workaround. – Jesse Zhuang Jul 12 '16 at 20:42
  • 6
    ‘It’s the wild colour scheme that freaks me out,’ said Zaphod, whose love affair with the ship had lasted almost three minutes into the flight. 'Every time you try and operate these weird black controls that are labeled in black on a black background, a little black light lights up in black to let you know you’ve done it.’ – Martin Tournoij Jan 13 '17 at 18:15
1

There's a nice option called background.

from my .vimrc:

" sets dark background for terminal set background=dark

This will tell vim that you have a dark background, and therefore it should make the text light.

In vim, type :help 'background' to see the doc for this option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.