Vim Color Scheme Doesn't Work for One Specific Python File

Viewed 334

I have a Django application that contains numerous applications each of which each contain the usual Python files (models.py, views.py, test.py, etc.). I have set my Vim colorscheme to distinguished. Recently I noticed that the colorscheme doesn't take effect when I open a specific Python file in a particular directory, promotion/views.py. When I open that file, I see all my code but the color scheme isn't working. Instead I see a black background with all the fonts white. Interestingly, if I do ":colorscheme", it still says "distinguished". It would appear that some Vim configuration file is corrupted with respect to this one file. Here's why I think that:

  1. If I open any other .py file in that same promotion subdirectory or any other directory, the color scheme works.
  2. If I create a new file promotion/test.py, the color scheme works.
  3. If I rename that particular view.py file to newview.py, the color scheme works.
  4. If I delete promotion/views.py and recreate it (same path, same name), the colorscheme doesn't work nor do any of my vim-snippets snippets.

Here are the pertinent lines in my .vimrc file:

# $HOME/.vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Lokaltog/vim-distinguished'
" other plugins ...
call vundle#end()
filetype plugin indent on
colorscheme distinguished
set t_Co=256

Here are my .vim directories:

.vim
├── bundle
│   ├── vim-distinguished
│   ├── vim-snipmate
│   ├── vim-snippets
│   └── Vundle.vim
├── colors
│   ├── distinguished.vim
├── ftplugin
│   ├── python.vim
├── syntax
└── view
    ├── =+srv=+http=+example.com=+repo=+promotion=+admin.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+forms.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+migrations=+0002_auto_20170714_1906.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+models.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+newviews.py=
    ├── =+srv=+http=+exampe.com=+repo=+promotion=+test.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+tests=+test_cases.txt=
    ├── =+srv=+http=+example.com=+repo=+promotion=+tmp.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+urls.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+views2.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+views.py=
    ├── =+srv=+http=+example.com=+repo=+promotion=+views.py.bak=
    ├── ~=+.viminfo=
    └── ~=+.vimrc=

Here is python.vim:

" $HOME/.vim/ftplugin/python.vim
setlocal tabstop=4
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal expandtab
setlocal autoindent
setlocal smarttab
setlocal ruler

I tried deleting ~/.viminfo but that didn't fix the problem. I do code folding and can see some lines in my view subdirectory that pertain to the file in question. However, I'm afraid to do anything to the view files as I don't know what they do or if deleting them would corrupt my Vim setup.

Could there be some other Vim configuration file that I'm not aware of that contains information pertaining to this one specific promotion/views.py file that is corrupted?

1 Answers
Related