Vim does not highlight syntax when used in a Docker container

I created a Docker container based on the Opensuse 42.3 image. I have a problem with vim not doing syntax highlighting in my Opensuse 42.3 container. I am running a Docker image on an Opensuse 42.3 host. If I open a bash file from a container and use it :syntax on

, nothing happens. I am using the -it flag when called docker run

, and I can see colors in files / folders when I use ls

. Distorting the .vimrc file doesn't seem to do anything either. My XTERM environment variable is set to "xterm" and the file I view with vim is a file

I have set my linux home directory to the container home directory. What are some ways to check or run tests to see where the problem might be?

+3


source to share


1 answer


I used the command :hi

with vi open and the result was striking. According to Ingo Karkat, this meant no syntax definitions / file type detections were found in the container. I used zypper install -y vim-data

and vi started highlighting syntax in files.



+3


source







All Articles