aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-21 16:12:08 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-21 16:12:08 +1200
commit2baa8b5bb5a394c15549c7dda45f76a3ee3b4777 (patch)
tree82da0deaa89e7b11ee124e3ca84c7255566ccb65
parentMerge branch 'release/v0.57.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-2baa8b5bb5a394c15549c7dda45f76a3ee3b4777.tar.gz
dotfiles-2baa8b5bb5a394c15549c7dda45f76a3ee3b4777.zip
Merge branch 'release/v0.58.0'v0.58.0
* release/v0.58.0: Bump VERSION Remove encoding .vimrc settings Correct two .vimrc spelling errors Review GUI Vim options in .gvimrc Add \c and \C bindings for cursor lines Add 'belloff' .vimrc setting Simplify exm(1df) Use simpler Vim :helptags build command More deckchairs on the Titanic Run :nohlsearch on re-sourcing .vimrc Use new 'display' setting 'truncate' if available Use slightly more correct v:version check Compress/improve .vimrc plugin disabling comments More alphabetical ordering in .vimrc Abbreviate .vimrc comment on 'swapfile' setting Update comment on Vim 'spelllang' Arrange .vimrc option in alphabetical order
-rw-r--r--Makefile3
-rw-r--r--VERSION4
-rw-r--r--bin/exm.sh3
-rw-r--r--vim/gvimrc28
-rw-r--r--vim/vimrc107
5 files changed, 71 insertions, 74 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
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
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 "$@"
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 6431bd54..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
@@ -43,25 +37,35 @@ 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
+" 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=
-" 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
" 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
@@ -69,6 +73,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 +98,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)
@@ -106,18 +110,13 @@ 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]
-" 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
-set visualbell t_vb=
-
" Don't wrap by default, but use \w to toggle it on or off
set nowrap
@@ -128,8 +127,9 @@ endif
" Highlight settings for search, if available
if has('extra_search')
+ set hlsearch " Highlight completed searches...
+ nohlsearch " ...but clear it on startup or after re-sourcing
set incsearch " Show matches as I type
- set hlsearch " Highlight completed searches
endif
" Use all ancestors of current directory for :find
@@ -137,6 +137,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')
@@ -153,7 +159,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
@@ -240,10 +247,17 @@ 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 :<C-U>write!<CR>
" ZA does an unconditional write for all buffers
nnoremap ZA :<C-U>wall!<CR>
+" ZW does an unconditional write for this buffer
+nnoremap ZW :<C-U>write!<CR>
+
+" 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
@@ -259,6 +273,9 @@ endif
nnoremap \a :<C-U>ToggleOptionFlagLocal formatoptions a<CR>
" \b toggles copy-pasteable linebreak settings
nmap \b <Plug>CopyLinebreakToggle
+" \c toggles 'cursorcolumn', \C toggles 'cursorline'
+nnoremap \c :<C-U>set cursorcolumn! cursorcolumn?<CR>
+nnoremap \C :<C-U>set cursorline! cursorline?<CR>
" Current date and time insertion commands, requiring POSIX date(1)
if has('unix')
" \d: Local date
@@ -304,42 +321,28 @@ 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
- " 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