From a1f98223917affbdd9cb18469c3f26ef2613066c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 10:49:42 +1200 Subject: Arrange .vimrc option in alphabetical order --- vim/vimrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 6431bd54..84b0bcc2 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -69,6 +69,11 @@ endif " despite the noble Steve Losh's exhortations set nojoinspaces +" Don't bother drawing the screen while executing macros or other automated or +" scripted processes, just draw the screen as it is when the operation +" completes +set lazyredraw + " Define list characters set listchars+=extends:> " Unwrapped text to screen right set listchars+=precedes:< " Unwrapped text to screen left @@ -89,11 +94,6 @@ set nrformats-=octal " Always tell me the number of lines changed by a command set report=0 -" Don't bother drawing the screen while executing macros or other automated or -" scripted processes, just draw the screen as it is when the operation -" completes -set lazyredraw - " Set up short message settings set shortmess= set shortmess+=f " (file 3 of 5) -> (3 of 5) -- cgit v1.2.3 From 39e6c746e5a610287cd721d619200608b8c22b13 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 10:51:17 +1200 Subject: Update comment on Vim 'spelllang' --- vim/vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 84b0bcc2..243d2668 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -153,7 +153,8 @@ if has('linebreak') endif -" Use NZ english by default +" Use New Zealand English by default; binding later in this file allow +" masquerading as a Yankee if has('spell') set spelllang=en_nz endif -- cgit v1.2.3 From 2a2d511dceb69ead135e533e7c03294e94417a84 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 10:51:57 +1200 Subject: Abbreviate .vimrc comment on 'swapfile' setting --- vim/vimrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 243d2668..71fe8cc8 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -110,9 +110,7 @@ set shortmess+=T " Truncate other message in midle if too long set shortmess+=w " written -> [w], appended -> [a] set shortmess+=x " [dos format] -> [dos] -" Default to no swap files at all, in a way that even ancient/tiny Vims will -" understand; the auto_cache_dirs.vim plugin will take care of re-enabling -" this with a 'directory' setting +" Default to no swap files at all, let auto_cache_dirs.vim set it set noswapfile " Never use any kind of bell, visual or not -- cgit v1.2.3 From ed1004bf2593fe2aceb3d3a93bbf395b49676c6e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 10:59:26 +1200 Subject: More alphabetical ordering in .vimrc --- vim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 71fe8cc8..78ace282 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -126,8 +126,8 @@ endif " Highlight settings for search, if available if has('extra_search') - set incsearch " Show matches as I type set hlsearch " Highlight completed searches + set incsearch " Show matches as I type endif " Use all ancestors of current directory for :find @@ -239,10 +239,10 @@ nnoremap gk k " done with yy anyway); this fixes it so it only yanks the rest of the line nnoremap Y y$ -" ZW does an unconditional write for this buffer -nnoremap ZW :write! " ZA does an unconditional write for all buffers nnoremap ZA :wall! +" ZW does an unconditional write for this buffer +nnoremap ZW :write! " Use different keys for global and local leaders if 1 -- cgit v1.2.3 From ffb551759594718af4dcd8e88585f8062926dde9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 10:59:34 +1200 Subject: Compress/improve .vimrc plugin disabling comments --- vim/vimrc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 78ace282..1b7dd226 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -314,31 +314,24 @@ endif " clears these variables later if 1 - " 2html.vim is often useful, so keep that - " matchparen.vim I use constantly - - " I handle versioning plugins manually, and have never used .vba + " I use tohtml.vim often + " I like matchparen.vim + " I manage plugins myself with Git and a Makefile let g:loaded_getscriptPlugin = 1 let g:loaded_vimballPlugin = 1 - - " This is what grep, sed, Awk, and Perl are for + " Vim is the wrong tool for reading archives or compressed text + let g:loaded_gzip = 1 + let g:loaded_tarPlugin = 1 + let g:loaded_zipPlugin = 1 + " I prefer filtering text with Unix tools let g:loaded_logiPat = 1 - - " ^Z, my dudes + " The shell, tab completion, and 'wildmenu' are good enough let g:loaded_netrwPlugin = 1 - - " Vim servers? What is this, Emacs? + " I don't use Vim servers let g:loaded_rrhelper = 1 - " System dictionaries plus custom per-machine spell files are fine let g:loaded_spellfile_plugin = 1 - " If I want to read a file or a file archived within it I'll decompress or - " unarchive it myself; a text editor should not do this - let g:loaded_gzip = 1 - let g:loaded_tarPlugin = 1 - let g:loaded_zipPlugin = 1 - endif " Source all .vim files from ~/.vim/config, which may override any of the -- cgit v1.2.3 From bbafc15c70da6571ff19d4f99386638de5ec8cd0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 11:07:14 +1200 Subject: Use slightly more correct v:version check --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 1b7dd226..ae0d2e9f 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -61,7 +61,7 @@ set noesckeys " Try to set the 'j' flag for 'formatoptions', to automatically delete comment " leaders when joining lines, if supported -if v:version >= 704 || v:version == 703 && has('patch541') +if v:version > 703 || v:version == 703 && has('patch541') set formatoptions+=j endif -- cgit v1.2.3 From 4887d8c064a24c00bf0dafa3d475a119e360ba31 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 11:07:22 +1200 Subject: Use new 'display' setting 'truncate' if available --- vim/vimrc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index ae0d2e9f..971a3667 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -51,10 +51,13 @@ set backspace+=start " The start of current insertion " filetype handle it set comments= -" When wrapping text, if a line is so long that not all of it can be shown on -" the screen, show as much as possible anyway; by default Vim fills the left -" column with @ symbols instead, which I don't find very helpful -set display=lastline +" Show only one line of @ symbols for a truncated last line if possible, and +" show none at all if not +if v:version > 704 || v:version == 704 && has('patch2109') + set display=truncate +else + set display=lastline +endif " Don't wait to see if Escape in insert mode precedes a key for an Alt binding set noesckeys -- cgit v1.2.3 From 2e04c32a1fb1aac35960c19a610711a3bcd39769 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 11:10:49 +1200 Subject: Run :nohlsearch on re-sourcing .vimrc --- vim/vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 971a3667..100e1f16 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -129,7 +129,8 @@ endif " Highlight settings for search, if available if has('extra_search') - set hlsearch " Highlight completed searches + set hlsearch " Highlight completed searches... + nohlsearch " ...but clear it on startup or after re-sourcing set incsearch " Show matches as I type endif -- cgit v1.2.3 From 2e9959cdd030f32d06794d6ee978606269b05989 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 11:11:32 +1200 Subject: More deckchairs on the Titanic --- vim/vimrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 100e1f16..34d5b2c7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -248,6 +248,13 @@ nnoremap ZA :wall! " ZW does an unconditional write for this buffer nnoremap ZW :write! +" A few very important custom digraphs +if has('digraphs') + digraph ./ 8230 " Ellipsis (HORIZONTAL ELLIPSIS U+2026) + digraph %% 8984 " Mac command key (PLACE OF INTEREST SIGN U+2318) + digraph 8: 9731 " Snowman (SNOWMAN U+2603) +endif + " Use different keys for global and local leaders if 1 let g:mapleader = '\' @@ -307,13 +314,6 @@ if has('packages') packadd! matchit endif -" A few very important custom digraphs -if has('digraphs') - digraph ./ 8230 " Ellipsis (HORIZONTAL ELLIPSIS U+2026) - digraph %% 8984 " Mac command key (PLACE OF INTEREST SIGN U+2318) - digraph 8: 9731 " Snowman (SNOWMAN U+2603) -endif - " Disable most core plugin stuff that I don't use; after/plugin/dist.vim " clears these variables later if 1 -- cgit v1.2.3 From e08ee456bb6c7510b920ffbccd6da08f4efa1e3b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 11:36:23 +1200 Subject: Use simpler Vim :helptags build command --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b66b4aa0..9a80bf3e 100644 --- a/Makefile +++ b/Makefile @@ -538,8 +538,7 @@ install-vim-bundle: install-vim-config find vim/bundle/*/*/* \ -type f -exec sh -c \ 'cp -p -- "$$1" $(VIMDIR)/"$${1#vim/bundle/*/}"' _ {} \; - cmd=$$(printf 'set t_cm=\r|') ; \ - vim -eT dumb --cmd "$${cmd%|}" -c 'helptags $(VIMDIR)/doc' -c quit + vim --cmd 'helptags $(VIMDIR)/doc' --cmd quit install-vim-compiler: mkdir -p -- $(VIMDIR)/compiler -- cgit v1.2.3 From 1003a5b44711b3f3c4a3ca40082f6f4ddbe7567f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 11:47:27 +1200 Subject: Simplify exm(1df) I thought shell script stripped \r from the end of variables, but that does not actually seem to be the case. I think it's just newlines. --- bin/exm.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/exm.sh b/bin/exm.sh index 378b5baf..c25a611b 100644 --- a/bin/exm.sh +++ b/bin/exm.sh @@ -3,7 +3,6 @@ if [ -t 0 ] ; then # Lie to Vim; tell it it's a dumb terminal, and that its required "cm" # feature is invoked with a carriage return. - cmd=$(printf 'set t_cm=\r|') - set -- -T dumb --cmd "${cmd%|}" "$@" + set -- -T dumb --cmd "$(printf 'set t_cm=\r')" "$@" fi exec ex "$@" -- cgit v1.2.3 From 2acf2e504711e716a18a8dd7a31514ad19fbd3d0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 12:54:53 +1200 Subject: Add 'belloff' .vimrc setting --- vim/vimrc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 34d5b2c7..6f699bb7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -47,6 +47,13 @@ set backspace+=indent " Spaces from 'audoindent' set backspace+=eol " Line breaks set backspace+=start " The start of current insertion +" Never use any kind of bell, visual or not +if exists('+belloff') + set belloff=all +else + set visualbell t_vb= +endif + " Start with blank comment strings rather than the old default; let the " filetype handle it set comments= @@ -116,9 +123,6 @@ set shortmess+=x " [dos format] -> [dos] " Default to no swap files at all, let auto_cache_dirs.vim set it set noswapfile -" Never use any kind of bell, visual or not -set visualbell t_vb= - " Don't wrap by default, but use \w to toggle it on or off set nowrap -- cgit v1.2.3 From ae0b391b56037701114e5a62a7235cb67ae71cbd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 12:55:03 +1200 Subject: Add \c and \C bindings for cursor lines --- vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 6f699bb7..f12ac69e 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -273,6 +273,9 @@ endif nnoremap \a :ToggleOptionFlagLocal formatoptions a " \b toggles copy-pasteable linebreak settings nmap \b CopyLinebreakToggle +" \c toggles 'cursorcolumn', \C toggles 'cursorline' +nnoremap \c :set cursorcolumn! cursorcolumn? +nnoremap \C :set cursorline! cursorline? " Current date and time insertion commands, requiring POSIX date(1) if has('unix') " \d: Local date -- cgit v1.2.3 From 127c4aa5fe0018ce473624d52256fd3a9b59a0d4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 14:07:02 +1200 Subject: Review GUI Vim options in .gvimrc --- vim/gvimrc | 28 ++++++++++++---------------- vim/vimrc | 6 ++++++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/vim/gvimrc b/vim/gvimrc index 128a396a..edf4f9cd 100644 --- a/vim/gvimrc +++ b/vim/gvimrc @@ -1,21 +1,17 @@ -" My choice of font changes depending on which operating system I'm using; -" these are both workable monospace fonts, but Ubuntu Mono doesn't render very -" nicely on Windows a lot of the time +" Ubuntu Mono on Unix, Consolas on Windows if has('unix') - silent! let &guifont = 'Ubuntu Mono 12' -else - silent! let &guifont = 'Consolas:h11' + set guifont=Ubuntu\ Mono\ 12 +elseif has('win32') || has('win64') + set guifont=Consolas:h11,Courier\ New:h11 endif -" Reset guioptions +" Reset GUI options set guioptions= -" Use the system GUI clipboard -set guioptions+=a -" Use console dialogs instead of popup windows -set guioptions+=c -" Use the gVim icon -set guioptions+=i +set guioptions+=a " Use the system GUI clipboard +set guioptions+=c " Use console dialogs, not popup windows +set guioptions+=M " Don't load menu.vim (also set in .vimrc) -" When the GUI starts, t_vb is reset to its default value, so it's necessary -" to repeat this line from my .vimrc file that turns off visual bells -set visualbell t_vb= +" Stamp 'visualbell' back down again, if 'belloff' not available +if !exists('+belloff') + set visualbell t_vb= +endif diff --git a/vim/vimrc b/vim/vimrc index f12ac69e..b1176b65 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -143,6 +143,12 @@ if has('file_in_path') set path+=** endif +" Don't load menus at all in GUI mode; needs to be set here, before gVim +" actually starts up +if has('gui_running') + set guioptions+=M +endif + " Line break settings and mappings if has('linebreak') -- cgit v1.2.3 From a4fbbb0b09042c52a50559f5bc938723d5d4fbb4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 14:11:16 +1200 Subject: Correct two .vimrc spelling errors --- vim/vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index b1176b65..623d91e1 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -43,7 +43,7 @@ set softtabstop=4 " Insert four spaces for a Tab press " Let me backspace over pretty much anything set backspace= -set backspace+=indent " Spaces from 'audoindent' +set backspace+=indent " Spaces from 'autoindent' set backspace+=eol " Line breaks set backspace+=start " The start of current insertion @@ -116,7 +116,7 @@ set shortmess+=o " Don't stack file writing messages set shortmess+=O " Don't stack file reading messages set shortmess+=r " [readonly] -> [RO] set shortmess+=t " Truncate file message at start if too long -set shortmess+=T " Truncate other message in midle if too long +set shortmess+=T " Truncate other message in middle if too long set shortmess+=w " written -> [w], appended -> [a] set shortmess+=x " [dos format] -> [dos] -- cgit v1.2.3 From bfa355ccda8e63923092d67458450fd5ffa4366f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 15:23:34 +1200 Subject: Remove encoding .vimrc settings * 'encoding' defaults to locale, which makes sense * `scriptencoding` is only necessary if there's UTF-8 encoded stuff in the file, and there isn't (yet) --- vim/vimrc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 623d91e1..07c26448 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -4,12 +4,6 @@ " own without the accompanying plugins to which it refers near the end of this " file, but you'll get errors for some of the leader maps, for example. -" Use UTF-8 by default wherever possible -if has('multi_byte') - set encoding=utf-8 - scriptencoding utf-8 -endif - " Load filetype-specific plugins, indent settings, and syntax highlighting if has('autocmd') filetype plugin indent on -- cgit v1.2.3 From a34f5ce69bcd7ee333816355431b316b8159b41d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 21 Jun 2018 16:11:45 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index c73e8a6d..f5e615bb 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v0.57.0 -Wed Jun 20 22:19:12 UTC 2018 +tejr dotfiles v0.58.0 +Thu Jun 21 04:11:39 UTC 2018 -- cgit v1.2.3