I just ran a package upgrade with zypper, and when everything finished, I used vim and found that the syntax highlighting no longer works. I force reinstalled vim, vim-data, and vim-common, and the reinstallations did not fix the problem. When I run the reinstallation of vim, I see the following output.
Loading repository data...
Reading installed packages...
Forcing installation of 'vim-8.0.1568-lp152.8.3.1.x86_64' from repository 'Main Update Repository'.
Resolving package dependencies...
The following package is going to be reinstalled:
vim
1 package to reinstall.
Overall download size: 1.5 MiB. Already cached: 0 B. No additional space will be used or freed after the operation.
Continue? [y/n/v/...? shows all options] (y):
Retrieving package vim-8.0.1568-lp152.8.3.1.x86_64 (1/1), 1.5 MiB ( 3.0 MiB unpacked)
Retrieving: vim-8.0.1568-lp152.8.3.1.x86_64.rpm ........................................................................................................................................................................................................[done]
Checking for file conflicts: ...........................................................................................................................................................................................................................[done]
(1/1) Installing: vim-8.0.1568-lp152.8.3.1.x86_64 ......................................................................................................................................................................................................[done]
Additional rpm output:
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/vim-nox11 because link group vim is broken
Does anyone have any idea what might be wrong? If I am posting in the wrong place, can someone let me know where to post? Thank you.
I guess that this isn’t a problem: I found that I can turn on the syntax highlighting in the configuration files. Though I can’t see the previous system configuration, I’m guessing that the package maintainer changed the systemwide configuration files.
I’m a certified hater of vim syntax highlighting. So, for many years, I removed “/etc/vimrc” after every update.
I eventually discovered that I could put the line “syntax off” in “$HOME/.vimrc” and never be bothered by this again.
So, to be clear, I approve this change. It is an improvement. But you can set “syntax on” in your “.vimrc” if you happen to like syntax highlighting.
I’ll note that the update to “vim” was listed as “optional”. So you did not have to install it. However, it is automatically installed if you use “zypper up” for updates. And it is probably automatically installed by the desktop update applet (not tested, because I don’t normally use that).
Whether to use syntax highlighting should be a personal choice, not a system-wide choice.
I’m agnostic with respect to the correct setting, but I object to package maintainers changing long-standing system configuration defaults without some kind of announcement with the update. When you change long-standing defaults, you are going to cause a lot of confusion and support problems, so you need to issue some kind of advisory and make some kind of searchable record. If you search on Google for the vim syntax highlighting in OpenSUSE and limit the search to the last month, you find nothing.
I especially object in the case of the syntax highlighting setting. Because syntax highlighting depends on the correct installation of a lot of supporting files, the change in the systemwide setting can mistakenly lead one to believe that there is something wrong with the supporting syntax files or the ability of the package to find the supporting files, my first assumption since nothing about my individual configuration changed and since the system settings had been stable for years. After all, the setting isn’t like the auto indent, line number, or show match settings, which I believe to be internal to the program and not associated with supporting external data; if show match isn’t working, longtime vi users will know immediately to change the setting.
I agree that changing defaults is one of the most irritating things that can happen. IMHO it shows that a maintainer is so convinced of his new invention that he believes that everybody will embrace and enjoy it.
That’s baby with the bathwater. New vim update added plugin for SPEC files with corresponding auotcmd to insert SPEC file template when new file is created (/usr/share/vim/vim80/plugin/spec.vim). It did it silently, without any entry in changelog. Because /etc/vimrc provided the same autocmd, template was added twice. Which was “solved” in rather crude way. Quoting Request 817920: Submit vim - openSUSE Build Service
+- stop owning /etc/vimrc so the old, distro provided config actually
+ gets removed. Leaving it around leads to a duplicated autocmd for
+ *.spec, leading to spec file template inserted twice.
The correct solution would have been to remove SPEC file handling from /etc/vimrc leaving other code as is.
And this certainly should not have gone with Leap 15.2. It being a “stable” release, users do not expect a change in functionality during it’s lifetime. Going to 15.3 I would study the release notes for these sorts of surprises.
I wan’t aware that syntax highlighting is on by default in vim at any time.
Just checked a couple of my machines and it’s not on by default.
But,
Syntax highlighting has been on by default in any terminal emulator except for xterm (Simply use xterm if you don’t want any openSUSE enhancements).
Vim syntax highlighting can be enabled in the configuration files as mentioned, and by vim plugins…
It has been on by default with “xterm” too. I know, because I mainly use “xterm” as a terminal and the annoying syntax highlighting shows up there (until I worked out how to turn it off).
The file ‘/etc/vimrc’ is indeed supplied with the “vim” package and, it’s dated “2017/04/28” – the 28th of April 2017 – and, it’s maintained by SUSE staff members …
The patch installed in August this year on this system …
Did the patch create an “.rpmsave” or “.rpmnew” version of the configuration file?
[HR][/HR]
BTW, I find that, syntax highlighting is one of the more useful items in this modern world – it helps to avoid errors due to the wrong “Type” [in the sense of a Data “type” or Object “type”] being inadvertently used – but, that’s only a personal opinion …
I also find that, the Lilypond syntax highlighting for Vim helps with music engraving – the production of sheet music – which is a little bit like programming but, somewhat more artistic – “Gödel, Escher and, Bach” …
Just noticed, an optional patch on today’s list: openSUSE-2020-2068 –
This update for vim doesn't fix any user visible issues and it is optional to install.
- Introduce vim-small package with reduced requirements for small installations (bsc#1166602).
- Stop owning /etc/vimrc so the old, distro provided config actually gets removed.
- Own some dirs in vim-data-common so installation of vim-small doesn't leave not owned directories. (bsc#1173256)
- Add vi as slave to update-alternatives so that every package has a matching "vi" symlink. (bsc#1174564, bsc#1176549)
This update was imported from the SUSE:SLE-15:Update update project.
Meaning that, the “syntax on” in the SUSE maintained ‘/etc/vimrc’ will disappear – if this optional patch is installed …
IMHO that is the one we are talking about all the time.
Mark that is says “… doesn’t fix any user visible issues…” And no, it does not fix them, it introduces at least one.
Also, when I read what follows I get the strong idea that it is something very much internal to the product that needs some cleaning up. Nothing that warns you, innocent system manager, let alone, the still simpler user, of a change in his day to day scores.
After the last vim update, you won’t see them unless you turn them on.
I just logged into Leap 15.1, which I have not recently updated. So “/etc/vimrc” still exists there.
I renamed my own “.vimrc” to “.vimrc.old” so that wouldn’t affect anything.
Using “xterm” I edited a shell script and saw syntax highlighting.
I then tried editing “/usr/share/doc/release-notes/openSUSE/RELEASE-NOTES.en.html” which is an html file. And that, too, showed syntax highlighting in hard-to-read colors.
Tsu, run “vimtutor” – down near the end, section 7 …
BTW, $VIMRUNTIME is set from within the Vim session – it ain’t set at the terminal’s login …
For me, within Vim – “:sh” and then “echo $VIMRUNTIME” – it points to ‘/usr/share/vim/vim80’ – which is also ‘/usr/share/vim/current’ …[HR][/HR]
For me, the user “root” (not “sudo” but, “su --login”) has syntax highlighting – without a “~/.vimrc” file …
Either, copying ‘/usr/share/vim/vim80/vimrc_example.vim’ to ‘~/.vmirc’ or, doing “the Vim way” – for a non-existent ‘~/.vimrc’ – “vi ~/.vmrc” and then “:r $VIMRUNTIME/vimrc_example.vim” and then either “:w” or “ZZ” – works just fine …