Vim syntax highlight broke

After applying all updates (f42 workstation) and rebooting, vim in the terminal (MATE terminal) is not applying color syntax highlighting to any of my files. I tried :set syntax=on in the internal command prompt and nada.

Also, my bash scripts don’t have color syntax highlighting.

My guess is something in the updates broke something. Suggestions? LaTeX can be used without it but not as easily. Color in the terminal itself works, it’s the color syntax highlight in vim that broke.

1 Like

Looks like a vim update might have broken it:

mpeters@fedora:~$ sudo dnf history info 84 |grep "vim"
  Upgrade  vim-common-2:9.1.2146-1.fc42.x86_64                Dependency      updates
  Upgrade  vim-data-2:9.1.2146-1.fc42.noarch                  Dependency      updates
  Upgrade  vim-enhanced-2:9.1.2146-1.fc42.x86_64              Group           updates
  Upgrade  vim-minimal-2:9.1.2146-1.fc42.x86_64               Group           updates
  Upgrade  vim-filesystem-2:9.1.2146-1.fc42.noarch            Dependency      updates
  Replaced vim-common-2:9.1.2114-1.fc42.x86_64                Dependency      @System
  Replaced vim-data-2:9.1.2114-1.fc42.noarch                  Dependency      @System
  Replaced vim-enhanced-2:9.1.2114-1.fc42.x86_64              Group           @System
  Replaced vim-filesystem-2:9.1.2114-1.fc42.noarch            Dependency      @System
  Replaced vim-minimal-2:9.1.2114-1.fc42.x86_64               Group           @System
mpeters@fedora:~$
1 Like

dammit, tried dnf downgrade but it seems the relevant packages aren’t in the repos aymore. This really sucks.

I just updated to check, and it seems to work fine here at the moment. Syntax highlighting and all my plugins:

(ins)[asinha@atlas  ~]$ rpm -qa \*vim\*
notmuch-vim-0.39-10.fc43.x86_64
vimiv-qt-0.9.0-13.fc43.x86_64
vim-data-9.1.2146-1.fc43.noarch
vim-filesystem-9.1.2146-1.fc43.noarch
vim-common-9.1.2146-1.fc43.x86_64
vim-X11-9.1.2146-1.fc43.x86_64
vim-enhanced-9.1.2146-1.fc43.x86_64
vim-minimal-9.1.2146-1.fc43.x86_64

I’m on gnome-terminal via byobu + tmux.

Tested these file types so far:

  • python
  • sh
  • tex

Is it worth checking it without any configs the usual way?

vim u NONE ..?

I tried this and then used :syntax enable and syntax highlighting seemed to work fine in a .sh file.


quick note: I use vimx. My bashrc has:

alias vim='vimx --servername $(pwgen 8 1)'

this seems to work for downgrades:

$ sudo dnf downgrade \*vim\*
[sudo] password for asinha: 
Updating and loading repositories:
Repositories loaded.
The lowest available version of the "notmuch-vim.x86_64" package is already installed, cannot downgrade it.

Package                                                          Arch           Version                                                          Repository                               Size
Downgrading:
 vim-X11                                                         x86_64         2:9.1.1818-1.fc43                                                fedora                                4.5 MiB
   replacing vim-X11                                             x86_64         2:9.1.2146-1.fc43                                                updates                               4.6 MiB
 vim-common                                                      x86_64         2:9.1.1818-1.fc43                                                fedora                               36.9 MiB
   replacing vim-common                                          x86_64         2:9.1.2146-1.fc43                                                updates                              37.9 MiB
 vim-data                                                        noarch         2:9.1.1818-1.fc43                                                fedora                               10.2 KiB
   replacing vim-data                                            noarch         2:9.1.2146-1.fc43                                                updates                              10.2 KiB
 vim-enhanced                                                    x86_64         2:9.1.1818-1.fc43                                                fedora                                4.2 MiB
   replacing vim-enhanced                                        x86_64         2:9.1.2146-1.fc43                                                updates                               4.2 MiB
 vim-filesystem                                                  noarch         2:9.1.1818-1.fc43                                                fedora                               40.0   B
   replacing vim-filesystem                                      noarch         2:9.1.2146-1.fc43                                                updates                              40.0   B
 vim-minimal                                                     x86_64         2:9.1.1818-1.fc43                                                fedora                                1.7 MiB
   replacing vim-minimal                                         x86_64         2:9.1.2146-1.fc43                                                updates                               1.7 MiB
 vimiv-qt                                                        x86_64         0.9.0-12.fc43                                                    fedora                                1.6 MiB
   replacing vimiv-qt                                            x86_64         0.9.0-13.fc43                                                    @commandline                          1.6 MiB

Transaction Summary:
 Replacing:          7 packages
 Downgrading:        7 packages

Total size of inbound packages is 14 MiB. Need to download 14 MiB.
After this operation, 1 MiB will be freed (install 49 MiB, remove 50 MiB).
Is this ok [y/N]: 
1 Like

Thanks! That worked and I got my syntax highlight back after that, so it was the update that broke it.

I had tried sudo downgrade specifying name-version as specified on a google search result, I guess that was incorrect.

But the old vim build is back and vim syntax highlighting is back.

1 Like

Nice. Glad that worked.

If you do want to try to figure out what’s breaking here, we could do that too—plugins are usually the culprits for this sort of thing from the few times I’ve had something break. Otherwise, the vim updates a usually very stable for me.

AFAIK I don’t use any plugins, not unless some package installed them as a dep. This is my ~/.vimrc:

mpeters@fedora:~/GITLAB/roundvalleybook/content$ cat ~/.vimrc 
:set expandtab
:set syntax=on
mpeters@fedora:~/GITLAB/roundvalleybook/content$

That second line was my attempt to fix it after the update, and it didn’t.

1 Like

I’ll double-check, but when I used this, it didn’t work either. This did though:

:syntax enable

It’s what’s listed in the :help syntax docs too now, along with :syntax on

So perhaps, set syntax=on is deprecated? I’ll need to go look. It’s what I’ve used in the past too.


Here’s my vimrc by the way—for LaTeX, vimtex is a really good plugin to have:

the previously installed vim version ( vim-*-2:9.1.2114-1.fc42.x86_64 ) is available in repo updates-archive or you can download the specific build from koji.

dnf rq --repo updates-archive vim-\*-2:9.1.2114-1\* --releasever=42
Updating and loading repositories:
Repositories loaded.
vim-X11-2:9.1.2114-1.fc42.x86_64
vim-common-2:9.1.2114-1.fc42.x86_64
vim-data-2:9.1.2114-1.fc42.noarch
vim-default-editor-2:9.1.2114-1.fc42.noarch
vim-enhanced-2:9.1.2114-1.fc42.x86_64
vim-filesystem-2:9.1.2114-1.fc42.noarch
vim-minimal-2:9.1.2114-1.fc42.x86_64

The fedora repo has the vim version ( 9.1.1227-1) from f42 release day.

dnf rq --repo fedora  vim-common --releasever=42
Updating and loading repositories:
Repositories loaded.
vim-common-2:9.1.1227-1.fc42.x86_64

universal keyword syntax (not specific to type of file being edited) highlight is still broken, e.g. TODO and FIXME don’t highlight and they should, so there must be some package without vim in the name that broke things.

It was all working just fine before I did the update. THIS is why I loved CentOS up through CentOS 7 - never had to deal broken packages being pushed through the update repos because a packager decided to make changes.

Ah well.

I had this issue a few times in the past 10 days. Everytime I downgraded vim. However, wanted to check and it worked this time. I usually use ‘vi’ followed by code file name. I thought of trying ‘vim’ and it showed all syntax. Immediately I added an alias to vim as vi in my shell script.

1 Like

Tried it and it works - except universal keywords like FIXME and TODO are still not getting their highlight.

So it looks the packager (or upstream) changed the behavior of the vi command so that now it has to be aliased to vim to get the same behavior as in initial install.

The universal non-language specific issue is all I need to resolve now. That may be a change in the default configuration file that didn’t get reverted with the downgrade as that wasn’t fixed with the downgrade.

But thanks for the alias tip, now I can use current version and still at least have the language specific syntax highlight.

2 Likes

The latest vim update is adding that alias

* Mon Feb 16 2026 Zdenek Dohnal <zdohnal@redhat.com> - 2:9.1.2146-2
- provide previous vi->vim alias (fedora#2439657)
3 Likes

Awaiting update :slight_smile:

It should be ready as I did the upgrade about 6 hours ago.

1 Like

Thank you Villy. I just ran the update and all works as before. I also removed the alias I have setup :slight_smile: Much appreciated

Sorry, after removing the alias, the new patch still removes styling using ‘vi’ command. The new patch did not fix the alias issue. I had to re-instate my alias to vim in my login shell.

You should have a file named /etc/profile.d/vim.sh which would set the alias.

Thank you for the information Villy. Sorry, it works only on BASH. I have tried on other shells such as CSH, TCSH, SH and none of these work using the file from /etc/profile.d/vim.sh.