aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-17 00:22:36 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-17 00:22:36 +1200
commit9b53214dc18da5c54ea18435edf603d95a08f741 (patch)
tree8a280273960b7da90376928ed214b5e4c8682678
parentadb22b6357e8a7e8f091b028b2094c48ff5c542c (diff)
downloaddotfiles-9b53214dc18da5c54ea18435edf603d95a08f741.tar.gz
Revert "Dispense with system-dependent files"
This reverts commit 1c51d2e98e0e0ec91da7ff3a93ad84f9767d0658. Already found problems--trips up using the -V command line option.
-rw-r--r--Makefile5
-rw-r--r--vim/system/centos.vim33
-rw-r--r--vim/system/debian.vim18
-rw-r--r--vim/vimrc4
4 files changed, 58 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 350d891f..2a5abdbd 100644
--- a/Makefile
+++ b/Makefile
@@ -591,6 +591,11 @@ install-vim-compiler:
install-vim-config: install-vim-cache
cp -p -- vim/vimrc.stub.vim $(HOME)/.vimrc
cp -p -- vim/vimrc $(VIMRC)
+ if [ -e /etc/debian_version ] ; then \
+ cp -p -- vim/system/debian.vim $(VIMDIR)/system.vim ; \
+ elif [ -e /etc/centos-release ] ; then \
+ cp -p -- vim/system/centos.vim $(VIMDIR)/system.vim ; \
+ fi
install-vim-filetype:
cp -p -- vim/filetype.vim vim/scripts.vim $(VIMDIR)
diff --git a/vim/system/centos.vim b/vim/system/centos.vim
new file mode 100644
index 00000000..3c1dbc48
--- /dev/null
+++ b/vim/system/centos.vim
@@ -0,0 +1,33 @@
+" Revert settings that CentOS might have touched
+if $VIM !=# '/usr/share/vim'
+ \ || !filereadable('/etc/centos-release')
+ finish
+endif
+
+" Set options back to appropriate defaults
+set history&
+if has('cmdline_info')
+ set ruler&
+endif
+if has('cscope')
+ set cscopeprg&
+ set cscopetag&
+ set cscopetagorder&
+ set cscopeverbose&
+ silent! cscope kill
+endif
+if has('gui')
+ set guicursor&
+endif
+if has('viminfo')
+ set viminfo&
+endif
+
+" Restore terminal settings to reflect terminfo
+set t_Co& t_Sf& t_Sb&
+
+" Delete autocmd groups
+augroup redhat
+ autocmd!
+augroup END
+augroup! redhat
diff --git a/vim/system/debian.vim b/vim/system/debian.vim
new file mode 100644
index 00000000..07649f07
--- /dev/null
+++ b/vim/system/debian.vim
@@ -0,0 +1,18 @@
+" Revert settings that Debian might have touched
+if $VIM !=# '/usr/share/vim'
+ \ || !filereadable('/etc/debian_version')
+ finish
+endif
+
+" Set options back to appropriate defaults
+set history&
+set printoptions&
+set ruler&
+set suffixes&
+
+" Restore terminal settings to reflect terminfo
+set t_Co& t_Sf& t_Sb&
+
+" Remove addons directories from 'runtimepath' if present
+set runtimepath-=/var/lib/vim/addons
+set runtimepath-=/var/lib/vim/addons/after
diff --git a/vim/vimrc b/vim/vimrc
index 7b2485a6..eeb468ff 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,8 +1,8 @@
" Tom Ryder (tejr)'s vimrc: <https://sanctum.geek.nz/cgit/dotfiles.git>
" Requires Vim 7.0 or newer with +eval.
-" Revert everything to Vim defaults
-set all&
+" Undo anything the operating system's vimrc may have broken
+runtime system.vim
" Set an environment variable for the user runtime directory
if !exists('$MYVIMRUNTIME')