aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-02 20:01:05 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-02 20:01:05 +1200
commit890815c7de274c0b4aeef26896e0c67569ff799b (patch)
tree441b6c3d7c1bb8e9661ae382bbc073aececadd3b
parentMerge branch 'hotfix/v1.16.1' into develop (diff)
downloaddotfiles-890815c7de274c0b4aeef26896e0c67569ff799b.tar.gz
dotfiles-890815c7de274c0b4aeef26896e0c67569ff799b.zip
Add CentOS and Debian .vim tweaks
-rw-r--r--Makefile5
-rw-r--r--vim/config/centos.vim29
-rw-r--r--vim/config/debian.vim34
3 files changed, 50 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 3afe0265..7e4260bf 100644
--- a/Makefile
+++ b/Makefile
@@ -550,7 +550,10 @@ install-vim-compiler:
install-vim-config:
mkdir -p -- $(VIMDIR)/config
cp -p -- vim/vimrc $(VIMRC)
- cp -p -- vim/config/*.vim $(VIMDIR)/config
+ test -e /etc/debian_version \
+ && cp -p -- vim/config/debian.vim $(VIMDIR)/config
+ test -e /etc/centos-release \
+ && cp -p -- vim/config/centos.vim $(VIMDIR)/config
install-vim-filetype:
cp -p -- vim/filetype.vim vim/scripts.vim $(VIMDIR)
diff --git a/vim/config/centos.vim b/vim/config/centos.vim
new file mode 100644
index 00000000..26289bf8
--- /dev/null
+++ b/vim/config/centos.vim
@@ -0,0 +1,29 @@
+" 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 csprg& cst& csto& csverb&
+ silent! cs 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/config/debian.vim b/vim/config/debian.vim
index e50fc260..125a9240 100644
--- a/vim/config/debian.vim
+++ b/vim/config/debian.vim
@@ -1,21 +1,21 @@
" Revert settings that Debian might have touched
-if $VIM ==# '/usr/share/vim' && filereadable('/etc/debian_version')
-
- " Set options back to appropriate defaults
- set history&
- set suffixes&
- if has('cmdline_info')
- set ruler&
- endif
- if has('printoptions')
- set printoptions&
- endif
+if $VIM !=# '/usr/share/vim' || !filereadable('/etc/debian_version')
+ finish
+endif
- " Restore terminal settings to reflect terminfo
- set t_Co& t_Sf& t_Sb&
+" Set options back to appropriate defaults
+set history&
+set suffixes&
+if has('cmdline_info')
+ set ruler&
+endif
+if has('printoptions')
+ set printoptions&
+endif
- " Remove addons directories from 'runtimepath' if present
- silent! set runtimepath-=/var/lib/vim/addons
- silent! set runtimepath-=/var/lib/vim/addons/after
+" Restore terminal settings to reflect terminfo
+set t_Co& t_Sf& t_Sb&
-endif
+" Remove addons directories from 'runtimepath' if present
+silent! set runtimepath-=/var/lib/vim/addons
+silent! set runtimepath-=/var/lib/vim/addons/after