Source /etc/vimrc.local if it exists

There seems to be no good way to extend distro-provided vimrc. If the
user modifies /etc/vimrc, then RPM will keep it intact from then on,
with subsequent distribution updates going into a .rpmnew file. Sad.

On Debian the user is supposed to put the local overrides into a
vimrc.local file next to the main vimrc. That is pretty neat -- the
local configuration is separated from the system one and can be updated
independently. Let's do the same thing.
This commit is contained in:
Lubomir Rintel 2020-03-16 20:52:45 +01:00
parent 8bd4fb37d4
commit 7c865ceb25
2 changed files with 9 additions and 1 deletions

View File

@ -21,7 +21,7 @@ Summary: The VIM editor
URL: http://www.vim.org/
Name: vim
Version: %{baseversion}.%{patchlevel}
Release: 1%{?dist}
Release: 2%{?dist}
License: Vim and MIT
Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2
Source1: vim.sh
@ -783,6 +783,9 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
%{_datadir}/icons/locolor/*/apps/*
%changelog
* Mon Mar 16 2020 Lubomir Rintel <lkundrak@v3.sk> - 2:8.2.390-2
- source /etc/vimrc.local if it exists
* Mon Mar 16 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.2.390-1
- patchlevel 390

5
vimrc
View File

@ -121,3 +121,8 @@ endif
" Don't wake up system with blinking cursor:
let &guicursor = &guicursor . ",a:blinkon0"
" Source a global configuration file if available
if filereadable("/etc/vimrc.local")
source /etc/vimrc.local
endif