From 014e440a9ab61b2dfce9ac37dc56391be936648c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 11:45:39 +1200 Subject: Tolerate spaces for final reply move --- vim/after/ftplugin/mail.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 47c82bb6..2e63c449 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -34,7 +34,7 @@ if line('.') == 1 && col('.') == 1 endwhile " Now move to the first quoted or unquoted blank line - call search('\m^>\=$', 'c') + call search('\m^>\= *$', 'c') endif -- cgit v1.2.3 From 334f4135331df528cef4107cf56deaea04418751 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 15:20:49 +1200 Subject: Remove per-system vimrc fixing This is just overkill. Move the useful bits into the vimrc. --- Makefile | 5 ----- vim/system/centos.vim | 33 --------------------------------- vim/system/debian.vim | 18 ------------------ vim/vimrc | 15 ++++++++++++--- 4 files changed, 12 insertions(+), 59 deletions(-) delete mode 100644 vim/system/centos.vim delete mode 100644 vim/system/debian.vim diff --git a/Makefile b/Makefile index 11364324..9468ff85 100644 --- a/Makefile +++ b/Makefile @@ -588,11 +588,6 @@ 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 deleted file mode 100644 index 3c1dbc48..00000000 --- a/vim/system/centos.vim +++ /dev/null @@ -1,33 +0,0 @@ -" 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 deleted file mode 100644 index 07649f07..00000000 --- a/vim/system/debian.vim +++ /dev/null @@ -1,18 +0,0 @@ -" 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 0456679f..ad30cd63 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,9 +1,6 @@ " Tom Ryder (tejr)'s vimrc: " Requires Vim 7.0 or newer with +eval. -" Undo anything the operating system's vimrc may have broken -runtime system.vim - " Set an environment variable for the user runtime directory if !exists('$MYVIM') if has('win32') || has('win64') @@ -37,6 +34,12 @@ else set backupdir^=$MYVIM/cache/backup endif +" Restore insert mode 'backspace' limits to the stringent Vim default, if a +" system vimrc or Neovim's heretical defaults has messed with it +if &backspace !=# '' + set backspace= +endif + " Add some *nix paths not to back up if has('unix') set backupskip^=/dev/shm/* " Shared memory RAM disk @@ -151,6 +154,12 @@ if &ruler set noruler endif +" Remove Debian's 'runtimepath' nonsense if present +if &runtimepath =~# '/var/lib/vim/addons' + set runtimepath-=/var/lib/vim/addons + set runtimepath-=/var/lib/vim/addons/after +endif + " Make sessions usable set sessionoptions-=localoptions " No buffer options or mappings set sessionoptions-=options " No global options or mappings -- cgit v1.2.3 From 9e8f7a12f0ae15529105d423da16a2d24eebb123 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 15:26:37 +1200 Subject: Restore ternary syntax for $VIM setting Can't make up my mind... --- vim/vimrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index ad30cd63..0617b045 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -3,11 +3,11 @@ " Set an environment variable for the user runtime directory if !exists('$MYVIM') - if has('win32') || has('win64') - let $MYVIM = expand('~/vimfiles') - else - let $MYVIM = expand('~/.vim') - endif + let $MYVIM = expand( + \ has('win32') || has('win64') + \ ? '~/vimfiles' + \ : '~/.vim' + \ ) endif " The all-important default indent settings; filetypes to tweak -- cgit v1.2.3 From d1f7c14a185e89bafa5bf62ffbe00fd53c64bab2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 15:28:32 +1200 Subject: Use comma-separated syntax for multiple appends --- vim/vimrc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 0617b045..acb2173d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -43,8 +43,8 @@ endif " Add some *nix paths not to back up if has('unix') set backupskip^=/dev/shm/* " Shared memory RAM disk - set backupskip^=/usr/tmp/* " Hard-coded path for `sudo -e` 1/2 - set backupskip^=/var/tmp/* " Hard-coded path for `sudo -e` 2/2 + \,/usr/tmp/* " Hard-coded paths for `sudo -e` 1/2 + \,/var/tmp/* " Hard-coded paths for `sudo -e` 2/2 endif " Indent wrapped lines if supported (v7.4.338) @@ -58,7 +58,7 @@ set commentstring= " Add completion options set completeopt+=longest " Insert longest common substring -set completeopt+=menuone " Show the menu even if only one match + \,menuone " Show the menu even if only one match " Give me a prompt instead of just rejecting risky :write, :saveas set confirm @@ -133,11 +133,11 @@ set lazyredraw set linebreak " Define extra 'list' display characters -set listchars+=extends:> " Unwrapped text to screen right -set listchars+=nbsp:+ " Non-breaking spaces -set listchars+=precedes:< " Unwrapped text to screen left -set listchars+=tab:>- " Tab characters, preserve width -set listchars+=trail:_ " Trailing spaces +set listchars+=extends:> " Unwrapped text to screen right + \,nbsp:+ " Non-breaking spaces + \,precedes:< " Unwrapped text to screen left + \,tab:>- " Tab characters, preserve width + \,trail:_ " Trailing spaces " Don't allow setting options via buffer content set nomodeline -- cgit v1.2.3 From 31e4266cf7c0900dbccf83775647b12526482912 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 15:28:58 +1200 Subject: Use correct capitalisation for Neovim --- vim/vimrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index acb2173d..a5079345 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -78,7 +78,7 @@ if has('multi_byte') endif " Don't wait for a key after Escape in insert mode -" Not in NeoVim +" Not in Neovim if exists('+esckeys') set noesckeys endif @@ -121,7 +121,7 @@ set include= set incsearch " Don't show a status line if there's only one window -" This is Vim's default, but not NeoVim's +" This is Vim's default, but not Neovim's if &laststatus != 1 set laststatus=1 endif @@ -149,7 +149,7 @@ set nrformats-=octal set path-=/usr/include " Disable command line display of file position -" This is Vim's default, but not NeoVim's +" This is Vim's default, but not Neovim's if &ruler set noruler endif @@ -184,7 +184,7 @@ endif " No terminal mouse, even if we could; the manual says to set 't_RV', but " doing that doesn't seem to prevent 'ttyfast' from being set -" Not in NeoVim +" Not in Neovim if exists('+ttymouse') && &ttymouse !=# '' set ttymouse= endif -- cgit v1.2.3 From 57b1558767fe41ddfce82675836788530302867d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 15:29:07 +1200 Subject: Amend a couple of comments --- vim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index a5079345..152ecd81 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -148,8 +148,8 @@ set nrformats-=octal " Don't search /usr/include by default set path-=/usr/include -" Disable command line display of file position -" This is Vim's default, but not Neovim's +" Disable command line display of file position if a system vimrc or Neovim +" has switched it on if &ruler set noruler endif @@ -177,7 +177,7 @@ set splitright " Right of the current window, not left " Don't try to syntax highlight run-on lines set synmaxcol=500 -" PuTTY is a fast terminal +" PuTTY is a fast terminal, but Vim doesn't know that yet if &term =~# '^putty' set ttyfast endif -- cgit v1.2.3 From 2aaa4a70b3d1e82b93090b10c9200a708c240d6e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 15:55:25 +1200 Subject: Switch to a hyphen for trailing whitespace I think I like it better. --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 152ecd81..783323ff 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -137,7 +137,7 @@ set listchars+=extends:> " Unwrapped text to screen right \,nbsp:+ " Non-breaking spaces \,precedes:< " Unwrapped text to screen left \,tab:>- " Tab characters, preserve width - \,trail:_ " Trailing spaces + \,trail:- " Trailing spaces " Don't allow setting options via buffer content set nomodeline -- cgit v1.2.3 From db402d2d24d28bd892cd60de95aa78e3ce8271db Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 15:57:04 +1200 Subject: Only set 'background' if not already set right --- vim/vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 783323ff..f5d16880 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -245,7 +245,9 @@ try colorscheme sahara set cursorline catch - set background=dark + if &background != 'dark' + set background=dark + endif endtry " Remap normal space to scroll down a page -- cgit v1.2.3 From 525ca88a485b2d3aa175de562bd1dfa21a5fe734 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 16:04:59 +1200 Subject: Adjust comment layout I forgot that comments don't work inline with long :set commands. --- vim/vimrc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index f5d16880..9c5136b1 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -41,10 +41,11 @@ if &backspace !=# '' endif " Add some *nix paths not to back up +" /dev/shm: Shared memory RAM disk +" /usr/tmp: Hard-coded path for `sudo -e` 1/2 +" /var/tmp: Hard-coded path for `sudo -e` 2/2 if has('unix') - set backupskip^=/dev/shm/* " Shared memory RAM disk - \,/usr/tmp/* " Hard-coded paths for `sudo -e` 1/2 - \,/var/tmp/* " Hard-coded paths for `sudo -e` 2/2 + set backupskip^=/dev/shm/*,/usr/tmp/*,/var/tmp/* endif " Indent wrapped lines if supported (v7.4.338) @@ -57,8 +58,9 @@ set comments= set commentstring= " Add completion options -set completeopt+=longest " Insert longest common substring - \,menuone " Show the menu even if only one match +" longest: Insert longest common substring +" menuone: Show the menu even if only one match +set completeopt+=longest,menuone " Give me a prompt instead of just rejecting risky :write, :saveas set confirm @@ -133,11 +135,12 @@ set lazyredraw set linebreak " Define extra 'list' display characters -set listchars+=extends:> " Unwrapped text to screen right - \,nbsp:+ " Non-breaking spaces - \,precedes:< " Unwrapped text to screen left - \,tab:>- " Tab characters, preserve width - \,trail:- " Trailing spaces +" extends: Unwrapped text to screen right +" nbsp: Non-breaking spaces +" precedes: Unwrapped text to screen left +" tab: Tab characters, preserve width +" trail: Trailing spaces +set listchars+=extends:>,nbsp:+,precedes:<,tab:>-,trail:- " Don't allow setting options via buffer content set nomodeline -- cgit v1.2.3 From 13c31d581f9c8c9f0bd8c75a8da64a44545bf890 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 16:05:19 +1200 Subject: Use simple string check for 'runtimepath' --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 9c5136b1..54318c9a 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -158,7 +158,7 @@ if &ruler endif " Remove Debian's 'runtimepath' nonsense if present -if &runtimepath =~# '/var/lib/vim/addons' +if stridx(&runtimepath, '/var/lib/vim/addons') != -1 set runtimepath-=/var/lib/vim/addons set runtimepath-=/var/lib/vim/addons/after endif -- cgit v1.2.3 From 0879078862e8e9fe44037f91eff935275453dadc Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 16:12:10 +1200 Subject: Remove overzealous checks Let's wait to see if there actually are side effects from doing all this before we worry about it. --- vim/vimrc | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 54318c9a..740066dd 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -36,9 +36,7 @@ endif " Restore insert mode 'backspace' limits to the stringent Vim default, if a " system vimrc or Neovim's heretical defaults has messed with it -if &backspace !=# '' - set backspace= -endif +set backspace= " Add some *nix paths not to back up " /dev/shm: Shared memory RAM disk @@ -124,9 +122,7 @@ set incsearch " Don't show a status line if there's only one window " This is Vim's default, but not Neovim's -if &laststatus != 1 - set laststatus=1 -endif +set laststatus=1 " Don't redraw the screen during batch execution set lazyredraw @@ -153,15 +149,11 @@ set path-=/usr/include " Disable command line display of file position if a system vimrc or Neovim " has switched it on -if &ruler - set noruler -endif +set noruler " Remove Debian's 'runtimepath' nonsense if present -if stridx(&runtimepath, '/var/lib/vim/addons') != -1 - set runtimepath-=/var/lib/vim/addons - set runtimepath-=/var/lib/vim/addons/after -endif +set runtimepath-=/var/lib/vim/addons +set runtimepath-=/var/lib/vim/addons/after " Make sessions usable set sessionoptions-=localoptions " No buffer options or mappings @@ -186,9 +178,9 @@ if &term =~# '^putty' endif " No terminal mouse, even if we could; the manual says to set 't_RV', but -" doing that doesn't seem to prevent 'ttyfast' from being set -" Not in Neovim -if exists('+ttymouse') && &ttymouse !=# '' +" doing that doesn't seem to prevent 'ttyfast' from being set; check for +" option existence as this is not an option in Neovim +if exists('+ttymouse') set ttymouse= endif @@ -248,7 +240,7 @@ try colorscheme sahara set cursorline catch - if &background != 'dark' + if &background != 'dark' " Avoid reloading syntax files unnecessarily set background=dark endif endtry -- cgit v1.2.3 From 6a16a03d1f556bb2ab190c38e333e6a00f494adb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 16:12:54 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 8a69beb5..c83794c7 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v4.44.0 -Thu May 23 23:30:11 UTC 2019 +tejr dotfiles v4.45.0 +Fri May 24 04:12:54 UTC 2019 -- cgit v1.2.3