From e7aa501119290cef72beef60a14fe0f5b4cdfcf2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 2 Jul 2018 17:36:44 +1200 Subject: Map \e in Vim to force a buffer to be editable --- vim/vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 5b47d98f..5f3e06cf 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -225,6 +225,8 @@ nnoremap C :set cursorcolumn! cursorcolumn? nnoremap d :read !date " \D inserts the UTC date (POSIX date) nnoremap D :read !date -u +" \e forces a buffer to be editable +nnoremap e :set modifiable noreadonly " \f shows the current 'formatoptions' at a glance nnoremap f :set formatoptions? " \g changes directory to the current file's location -- cgit v1.2.3 From 890815c7de274c0b4aeef26896e0c67569ff799b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 2 Jul 2018 20:01:05 +1200 Subject: Add CentOS and Debian .vim tweaks --- Makefile | 5 ++++- vim/config/centos.vim | 29 +++++++++++++++++++++++++++++ vim/config/debian.vim | 34 +++++++++++++++++----------------- 3 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 vim/config/centos.vim 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 -- cgit v1.2.3 From 47a06511da299e18f965771d24b69f7e2566d950 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 2 Jul 2018 20:03:06 +1200 Subject: Use if not && for conditional install The whole expression evaluates true this way. --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7e4260bf..e864a7ad 100644 --- a/Makefile +++ b/Makefile @@ -550,10 +550,12 @@ install-vim-compiler: install-vim-config: mkdir -p -- $(VIMDIR)/config cp -p -- vim/vimrc $(VIMRC) - 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 + if [ -e /etc/debian_version ] ; then \ + cp -p -- vim/config/debian.vim $(VIMDIR)/config ; \ + fi + if [ -e /etc/centos-release ] ; then \ + cp -p -- vim/config/centos.vim $(VIMDIR)/config ; \ + fi install-vim-filetype: cp -p -- vim/filetype.vim vim/scripts.vim $(VIMDIR) -- cgit v1.2.3 From 373232dee94b84c09bece1b69528af5590f02fc1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 2 Jul 2018 20:03:48 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 69c31315..23b1aeb4 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v1.16.1 -Mon Jul 2 07:19:48 UTC 2018 +tejr dotfiles v1.17.0 +Mon Jul 2 08:03:40 UTC 2018 -- cgit v1.2.3