Vimrc inconsistent when using screen

I recently noticed that that auto indent is turned on for html, js, etc files in vim, even though I added “set paste” at the bottom of /etc/vimrc (as I want this for all users).

Adding “set noautoindent” to /etc/vimrc doesn’t fix the issue. Adding that to ~/.vimrc however does work. This is happens when working in a GNU Screen. So processing of /etc/vimrc is inconsistent for some commands.

Where would I go to have this explained, or fixed. To me it seems to be a bug, because most commands are processed correctly, but not all.

If there is no ~/.vimrc file then defaults.vim is loaded instead. Maybe the thing you’re changing in /etc/vimrc is being set back again in defaults.vim.

In my opinion, on a system-wide basis the easiest way to deal with this is to put the .vimrc that you want into /etc/skel and then any new user that you set up will automatically inherit the .vimrc that you want them to have. You’ll probably have other stuff that you want to customize in /etc/skel anyway so you might as well put in a .vimrc while you’re there. :slight_smile:

Thank you Frank.

I wasn’t aware of the defaults.vim file. I didn’t investigate if that throws this behaviour off (screen/no screen), since in the meanwhile I found putting “filetype indent off” in /etc/vimrc, fixed it for me.

I prefer to use /etc/vimrc over ~/.vimrc (via skel), as changes will be available for existing users too, without the need to update their custom files. Some users set their own preferences. But thank you for the suggestion.

The complaint came from a user that noticed a different when I moved them from a Centos 7 to Rocky 8 box. Both machines have identical /etc/vimrc files, though vim worked different.

Funny how people ask for upgrades, but want things to be exactly the same.