From 7c865ceb25cfdb642f482f255428c31a82ab5075 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mar 16 2020 19:52:45 +0000 Subject: 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. --- diff --git a/vim.spec b/vim.spec index 83a0111..e15f41e 100644 --- a/vim.spec +++ b/vim.spec @@ -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 - 2:8.2.390-2 +- source /etc/vimrc.local if it exists + * Mon Mar 16 2020 Zdenek Dohnal - 2:8.2.390-1 - patchlevel 390 diff --git a/vimrc b/vimrc index 18c5ed5..4842faf 100644 --- a/vimrc +++ b/vimrc @@ -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