From 5ba51bb0d6d088241dc435b58f56a1dbc5fc249d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 22 Jun 2018 13:51:52 +1200 Subject: Don't create ~/.vim/config --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 84c59ea8..74524338 100644 --- a/Makefile +++ b/Makefile @@ -545,7 +545,6 @@ install-vim-compiler: cp -p -- vim/compiler/*.vim $(VIMDIR)/compiler install-vim-config: - mkdir -p -- $(VIMDIR)/config cp -p -- vim/vimrc $(VIMRC) install-vim-filetype: -- cgit v1.2.3 From e6250bca0e9818538b953ee35c5bf6f60e2ea783 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 22 Jun 2018 21:12:06 +1200 Subject: Revise Vim 'shiftround' comment --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index a75e80fe..1037caf6 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -31,7 +31,7 @@ endif " The all-important default indent settings; filetypes to tweak set autoindent " Use indent of previous line on new lines set expandtab " Use spaces instead of tabs -set shiftround " Round indenting to multiples of 4 +set shiftround " Round indenting to multiples of 'shiftwidth' set shiftwidth=4 " Indent with four spaces set softtabstop=4 " Insert four spaces for a Tab press -- cgit v1.2.3 From dc24c30618aa6b1162c5759ee46611babaa03026 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 22 Jun 2018 21:12:33 +1200 Subject: Use negative Vim 'softtabstop' value From :help 'softtabstop': > When 'sts' is negative, the value of 'shiftwidth' is used. From :help version7.txt: > Patch 7.3.693 > Problem: Can't make 'softtabstop' follow 'shiftwidth'. > Solution: When 'softtabstop' is negative use the value of 'shiftwidth'. --- vim/vimrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 1037caf6..fb18a2bd 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -33,7 +33,14 @@ set autoindent " Use indent of previous line on new lines set expandtab " Use spaces instead of tabs set shiftround " Round indenting to multiples of 'shiftwidth' set shiftwidth=4 " Indent with four spaces -set softtabstop=4 " Insert four spaces for a Tab press + +" Spaces to insert on Tab key press; if supported, use negative value to +" mirror 'shiftwidth' +if v:version > 703 || v:version == 703 && has('patch693') + set softtabstop=-1 +else + set softtabstop=4 +endif " Let me backspace over pretty much anything set backspace= -- cgit v1.2.3 From 479fa1d350f7a4f95b47dc70d12468413c98591d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 22 Jun 2018 21:17:46 +1200 Subject: Adjust comment indent on .vimrc indent settings --- vim/vimrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index fb18a2bd..98feadf6 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -29,10 +29,10 @@ if has('syntax') && !has('g:syntax_on') endif " The all-important default indent settings; filetypes to tweak -set autoindent " Use indent of previous line on new lines -set expandtab " Use spaces instead of tabs -set shiftround " Round indenting to multiples of 'shiftwidth' -set shiftwidth=4 " Indent with four spaces +set autoindent " Use indent of previous line on new lines +set expandtab " Use spaces instead of tabs +set shiftround " Round indenting to multiples of 'shiftwidth' +set shiftwidth=4 " Indent with four spaces " Spaces to insert on Tab key press; if supported, use negative value to " mirror 'shiftwidth' -- cgit v1.2.3 From 15a908c369202ee3275add97e34c34f9e4aaebd7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 22 Jun 2018 23:51:11 +1200 Subject: Remove unneeded :vnoremap command --- vim/vimrc | 1 - 1 file changed, 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 98feadf6..41bffa51 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -222,7 +222,6 @@ nnoremap " Preserve the flags for a pattern when repeating a substitution with & nnoremap & :&& -vnoremap & :&& " Pressing ^L will clear highlighting until the next search-related operation nnoremap :nohlsearch -- cgit v1.2.3 From 0625928cffec63a68c39b9eeb222ae7e67dcccca Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 00:03:16 +1200 Subject: Alphabetically order 'backspace' flags --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 41bffa51..40800c16 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -44,8 +44,8 @@ endif " Let me backspace over pretty much anything set backspace= -set backspace+=indent " Spaces from 'autoindent' set backspace+=eol " Line breaks +set backspace+=indent " Spaces from 'autoindent' set backspace+=start " The start of current insertion " Never use any kind of bell, visual or not -- cgit v1.2.3 From efd92082c6c42c3172e8130950ef0fbb6b2eca61 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 00:21:15 +1200 Subject: Fix up .vimrc comments --- vim/vimrc | 89 ++++++++++++++++++++++++++------------------------------------- 1 file changed, 37 insertions(+), 52 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 40800c16..89de66cb 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -15,7 +15,7 @@ if has('syntax') && !has('g:syntax_on') " Use syntax highlighting syntax enable - " Use the 'sahara' colorscheme if using the GUI or if we have 256 colors + " Use my colorscheme if using the GUI or if we have 256 colors if has('gui_running') || &t_Co >= 256 silent! colorscheme sahara endif @@ -34,8 +34,8 @@ set expandtab " Use spaces instead of tabs set shiftround " Round indenting to multiples of 'shiftwidth' set shiftwidth=4 " Indent with four spaces -" Spaces to insert on Tab key press; if supported, use negative value to -" mirror 'shiftwidth' +" Spaces to insert on Tab key press; use negative value to mirror 'shiftwidth' +" if supported if v:version > 703 || v:version == 703 && has('patch693') set softtabstop=-1 else @@ -55,34 +55,28 @@ else set visualbell t_vb= endif -" Start with blank comment strings rather than the old default; let the -" filetype handle it +" Clear default comment string, let the filetype handle it set comments= -" Show only one line of @ symbols for a truncated last line if possible, and -" show none at all if not +" How to deal with lines wrapping beyond the last screen row if v:version > 704 || v:version == 704 && has('patch2109') - set display=truncate + set display=truncate " Show '@@@' on the last line, if supported else - set display=lastline + set display=lastline " Just let it run off the screen endif -" Don't wait to see if Escape in insert mode precedes a key for an Alt binding +" Don't wait for a key after Escape in insert mode set noesckeys -" Try to set the 'j' flag for 'formatoptions', to automatically delete comment -" leaders when joining lines, if supported +" Delete comment leaders when joining lines, if supported if v:version > 703 || v:version == 703 && has('patch541') set formatoptions+=j endif -" Don't join lines with two spaces at the end of sentences; I don't two-space, -" despite the noble Steve Losh's exhortations +" Don't join lines with two spaces at the end of sentences 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 +" Don't redraw the screen during batch execution set lazyredraw " Define list characters @@ -91,25 +85,23 @@ set listchars+=precedes:< " Unwrapped text to screen left set listchars+=tab:>- " Tab characters, preserve width set listchars+=trail:_ " Trailing spaces -" Add angle brackets to pairs of characters to match +" Add angle brackets to pairs of matched characters set matchpairs+=<:> -" Don't use modelines at all, they're apparently potential security problems -" and I've never used them anyway +" Don't allow setting options via buffer content set nomodeline -" Don't assume a number with a leading zero is octal; it's far more likely a -" zero-padded decimal, so increment and decrement with ^A and ^X on that basis +" Increment/decrement numbers with a leading zero as decimal, not octal set nrformats-=octal " Always tell me the number of lines changed by a command set report=0 -" Set up short message settings +" Abbreviate some of the regularly displayed messages set shortmess= set shortmess+=f " (file 3 of 5) -> (3 of 5) set shortmess+=i " [Incomplete last line] -> [noeol] -set shortmess+=I " I donated to Uganda, thanks Bram +set shortmess+=I " Don't show startup splash screen set shortmess+=l " 999 lines, 888 characters -> 999L, 888C set shortmess+=m " [Modified] -> [+] set shortmess+=n " [New File] -> [New] @@ -200,8 +192,7 @@ if has('windows') " Don't resize windows we're not splitting (tmux-like; think Mondrian) set noequalalways - " New split windows appear below or to the right of the existing window, - " not above or to the left per the default + " Split windows to the right and bottom set splitbelow if has('vertsplit') set splitright @@ -214,43 +205,39 @@ if has('windows') endif -" Rebind Ctrl-C in insert mode to undo the current insert operation +" Rebind insert Ctrl-C to undo the current insert operation inoremap u -" Rebind in normal mode as a lazy scroll +" Rebind normal to scroll down a page nnoremap -" Preserve the flags for a pattern when repeating a substitution with & +" Rebind normal & to preserve substitution flags nnoremap & :&& -" Pressing ^L will clear highlighting until the next search-related operation +" Stack normal Ctrl-L to clear search highlighting before redraw nnoremap :nohlsearch -" Cycle through things with unimpaired.vim-style bindings: -" Buffers +" Cycle through buffers nnoremap [b :bprevious nnoremap ]b :bnext -" Quicklist items (more often :helpgrep results) +" Cycle through quicklist items (more often :helpgrep results) nnoremap [c :cprevious nnoremap ]c :cnext -" Location list items +" Cycle through location list items nnoremap [l :lprevious nnoremap ]l :lnext -" Insert blank lines above and below via my custom unimpaired.vim rip +" Insert blank lines above and below current line nmap [ PutBlankLinesAbove nmap ] PutBlankLinesBelow -" Swap the j/gj and k/gk command pairs so that we move by screen row, not -" buffer line, with j/k +" Swap buffer line vs screen row motions nnoremap j gj nnoremap k gk nnoremap gj j nnoremap gk k -" Change and delete with C and D both cut off the remainder of the line from -" the cursor, but Y yanks the whole line, which is inconsistent (and can be -" done with yy anyway); this fixes it so it only yanks the rest of the line +" Remap Y to yank to end of line (consistent with C, D) nnoremap Y y$ " ZA does an unconditional write for all buffers @@ -265,15 +252,14 @@ if has('digraphs') digraph 8: 9731 " Snowman (SNOWMAN U+2603) endif -" Use different keys for global and local leaders +" Use different keys for global and local leaders for plugins if 1 let g:mapleader = '\' let g:maplocalleader = '_' endif -" Leader mappings below; we use a literal backslash rather than for -" the mappings here, because I want many of these to work even on tiny -" stripped-down Vims like Debian's. The settings above are for plugins. +" Leader mappings below; use a literal backslash rather than so that +" the non-plugin mappings work on vim-tiny " \a toggles 'formatoptions' 'a' flag using a plugin nnoremap \a :ToggleOptionFlagLocal formatoptions a @@ -284,9 +270,9 @@ 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 + " \d inserts the local date nnoremap \d :read !date - " \D: UTC + " \D inserts the UTC date nnoremap \D :read !date -u endif " \f shows the current 'formatoptions' at a glance @@ -312,17 +298,17 @@ nnoremap \r :source $MYVIMRC nnoremap \s :setlocal spell! spell? " \t shows current filetype nnoremap \t :set filetype? -" \u sets US English spelling +" \u sets US English spelling (compare \z) nnoremap \u :setlocal spelllang=en_us spelllang? " \w toggles wrapping nnoremap \w :set wrap! wrap? " \x strips trailing whitespace via a custom plugin nmap \x StripTrailingWhitespace -" \z sets NZ English spelling +" \z sets NZ English spelling (compare \u) nnoremap \z :setlocal spelllang=en_nz spelllang? " Add the packaged version of matchit.vim included in the distribution, if -" possible; plugin/macros.vim loads this for older Vims +" supported; plugin/macros.vim loads this for older Vims if has('packages') packadd! matchit endif @@ -346,11 +332,10 @@ if 1 let g:loaded_netrwPlugin = 1 " I don't use Vim servers let g:loaded_rrhelper = 1 - " System dictionaries plus custom per-machine spell files are fine + " I don't need extra spelling files let g:loaded_spellfile_plugin = 1 endif -" Source all .vim files from ~/.vim/config, which may override any of the -" above +" Source all .vim files from ~/.vim/config runtime! config/*.vim -- cgit v1.2.3 From c4d4c34b0b5e0f5b5ff16c1d628b3b2c67f6c6f0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 00:32:25 +1200 Subject: Remove 'swapfile' disable in .vimrc --- vim/vimrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 89de66cb..95f4eea7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -113,9 +113,6 @@ 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, let auto_cache_dirs.vim set it -set noswapfile - " Don't wrap by default, but use \w to toggle it on or off set nowrap -- cgit v1.2.3 From 11d4b85cd11494c85db4d2e4af0fe9039a081963 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 00:32:47 +1200 Subject: Remove 'wrap' disable from .vimrc Now that I think about it, if I'm opening a file with long lines I'm actually more likely to want to 'wrap', not less. --- vim/vimrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 95f4eea7..95dd972c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -113,9 +113,6 @@ set shortmess+=T " Truncate other message in middle if too long set shortmess+=w " written -> [w], appended -> [a] set shortmess+=x " [dos format] -> [dos] -" Don't wrap by default, but use \w to toggle it on or off -set nowrap - " Show my current position in the status bar, default format is fine if has('cmdline_info') set ruler -- cgit v1.2.3 From 63279b9d9aca72e608fd40cd1b0ec593320fdca0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 00:33:20 +1200 Subject: Remove 'equalalways' disable from .vimrc Just a change in preference. --- vim/vimrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 95dd972c..63adff53 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -183,9 +183,6 @@ endif " Configuration for window features if has('windows') - " Don't resize windows we're not splitting (tmux-like; think Mondrian) - set noequalalways - " Split windows to the right and bottom set splitbelow if has('vertsplit') -- cgit v1.2.3 From c84b1aaed9eea0220e3346848d119e0debb970a9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 00:33:53 +1200 Subject: Add [a, ]a shortcuts to cycle through Vim arg list --- vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 63adff53..67a0910e 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -208,6 +208,9 @@ nnoremap & :&& " Stack normal Ctrl-L to clear search highlighting before redraw nnoremap :nohlsearch +" Cycle through argument list +nnoremap [a :previous +nnoremap ]a :next " Cycle through buffers nnoremap [b :bprevious nnoremap ]b :bnext -- cgit v1.2.3 From d06b39884a0c6ee15520807a1adba841599f4eb9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 00:37:49 +1200 Subject: Remove 'spelllang' setting from .vimrc At least on this system, Vim seems to get this right on its own. --- vim/vimrc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 67a0910e..088aa4a9 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -152,12 +152,6 @@ if has('linebreak') endif -" Use New Zealand English by default; binding later in this file allow -" masquerading as a Yankee -if has('spell') - set spelllang=en_nz -endif - " When in visual block mode, let me move the cursor anywhere in the buffer; " don't restrict me only to regions with text if has('virtualedit') -- cgit v1.2.3 From eb3fa720c204aff6ad5d9eb43925c1af4f8ad27b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 01:11:10 +1200 Subject: More comment adjusting in .vimrc --- vim/vimrc | 74 ++++++++++++++++++++++++--------------------------------------- 1 file changed, 28 insertions(+), 46 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 088aa4a9..3e94c630 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -4,7 +4,7 @@ " 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. -" Load filetype-specific plugins, indent settings, and syntax highlighting +" Load filetype settings and plugins if has('autocmd') filetype plugin indent on endif @@ -20,8 +20,7 @@ if has('syntax') && !has('g:syntax_on') silent! colorscheme sahara endif - " If we couldn't use 'sahara', just flag a dark background (the author is - " almost certainly using one), and we'll use the default colorscheme + " If not sahara, then default with dark background if !exists('g:colors_name') set background=dark endif @@ -34,12 +33,11 @@ set expandtab " Use spaces instead of tabs set shiftround " Round indenting to multiples of 'shiftwidth' set shiftwidth=4 " Indent with four spaces -" Spaces to insert on Tab key press; use negative value to mirror 'shiftwidth' -" if supported +" Spaces to insert on Tab key insert if v:version > 703 || v:version == 703 && has('patch693') - set softtabstop=-1 + set softtabstop=-1 " Refer to 'shifwidth' if supported else - set softtabstop=4 + set softtabstop=4 " Otherwise just four spaces endif " Let me backspace over pretty much anything @@ -62,7 +60,7 @@ set comments= if v:version > 704 || v:version == 704 && has('patch2109') set display=truncate " Show '@@@' on the last line, if supported else - set display=lastline " Just let it run off the screen + set display=lastline " Just let it run off the screen if not endif " Don't wait for a key after Escape in insert mode @@ -91,7 +89,7 @@ set matchpairs+=<:> " Don't allow setting options via buffer content set nomodeline -" Increment/decrement numbers with a leading zero as decimal, not octal +" Treat numbers with a leading zero as decimal, not octal set nrformats-=octal " Always tell me the number of lines changed by a command @@ -113,71 +111,59 @@ set shortmess+=T " Truncate other message in middle if too long set shortmess+=w " written -> [w], appended -> [a] set shortmess+=x " [dos format] -> [dos] -" Show my current position in the status bar, default format is fine +" Show my current position in the status bar if has('cmdline_info') set ruler endif -" Highlight settings for search, if available +" Highlight settings for search 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 endif -" Use all ancestors of current directory for :find +" Use whole tree from current directory for :find 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 +" Don't load GUI menus; set here before GUI starts if has('gui_running') set guioptions+=M endif -" Line break settings and mappings +" Line break behaviour settings for 'wrap' if has('linebreak') + set linebreak " Break lines at word boundaries + set showbreak=... " Prefix wrapped rows with three dots - " Break lines at word boundaries if possible - set linebreak - - " Precede continued lines with '...' - set showbreak=... - - " If we have the option, indent wrapped lines as much as the first line + " Indent wrapped lines, if supported if exists('+breakindent') set breakindent endif endif -" When in visual block mode, let me move the cursor anywhere in the buffer; -" don't restrict me only to regions with text +" Let me move beyond buffer text in visual block mode if has('virtualedit') set virtualedit+=block endif -" Configuration for the command completion feature; rather than merely cycling -" through possible completions with Tab, show them above the command line +" Nicer completion for command mode if has('wildmenu') + set wildmenu " Use wildmenu + set wildmode=list:longest " Tab press completes and lists - " Use the wild menu, both completing and showing all possible completions - " with a single Tab press, just as I've configured Bash to do - set wildmenu - set wildmode=list:longest - - " Complete files without case sensitivity, if the option is available + " Complete files without case sensitivity, if supported if exists('+wildignorecase') set wildignorecase endif endif -" Configuration for window features +" New windows go below or to the right of a split if has('windows') - - " Split windows to the right and bottom set splitbelow if has('vertsplit') set splitright @@ -221,19 +207,19 @@ nmap ] PutBlankLinesBelow " Swap buffer line vs screen row motions nnoremap j gj -nnoremap k gk nnoremap gj j +nnoremap k gk nnoremap gk k " Remap Y to yank to end of line (consistent with C, D) nnoremap Y y$ -" ZA does an unconditional write for all buffers +" ZA unconditionally writes all buffers nnoremap ZA :wall! -" ZW does an unconditional write for this buffer +" ZW unconditionally writes current buffer nnoremap ZW :write! -" A few very important custom digraphs +" Custom digraphs if has('digraphs') digraph ./ 8230 " Ellipsis (HORIZONTAL ELLIPSIS U+2026) digraph %% 8984 " Mac command key (PLACE OF INTEREST SIGN U+2318) @@ -295,18 +281,14 @@ nmap \x StripTrailingWhitespace " \z sets NZ English spelling (compare \u) nnoremap \z :setlocal spelllang=en_nz spelllang? -" Add the packaged version of matchit.vim included in the distribution, if -" supported; plugin/macros.vim loads this for older Vims +" Add packaged matchit.vim, if supported if has('packages') packadd! matchit endif -" Disable most core plugin stuff that I don't use; after/plugin/dist.vim -" clears these variables later +" Disable core plugins I don't use if 1 - " 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 @@ -325,5 +307,5 @@ if 1 endif -" Source all .vim files from ~/.vim/config +" Source any .vim files from ~/.vim/config runtime! config/*.vim -- cgit v1.2.3 From bbd959a42ae6035db460c402315003d76d44f301 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:07:58 +1200 Subject: Don't reset 'backspace' in .vimrc --- vim/vimrc | 1 - 1 file changed, 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 3e94c630..fad38b7a 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -41,7 +41,6 @@ else endif " Let me backspace over pretty much anything -set backspace= set backspace+=eol " Line breaks set backspace+=indent " Spaces from 'autoindent' set backspace+=start " The start of current insertion -- cgit v1.2.3 From ae6952c2d9c9db979dc30358cbd82d625b39808d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:08:48 +1200 Subject: Reorder .vimrc mappings --- vim/vimrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index fad38b7a..4cf4b695 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -175,15 +175,15 @@ if has('windows') endif -" Rebind insert Ctrl-C to undo the current insert operation -inoremap u - " Rebind normal to scroll down a page nnoremap " Rebind normal & to preserve substitution flags nnoremap & :&& +" Stack insert Ctrl-C to undo the escaped insert operation +inoremap u + " Stack normal Ctrl-L to clear search highlighting before redraw nnoremap :nohlsearch @@ -193,7 +193,7 @@ nnoremap ]a :next " Cycle through buffers nnoremap [b :bprevious nnoremap ]b :bnext -" Cycle through quicklist items (more often :helpgrep results) +" Cycle through quicklist/:helpgrep items nnoremap [c :cprevious nnoremap ]c :cnext " Cycle through location list items -- cgit v1.2.3 From 2091b896ce8ee06806ecd7f4ad549028f80ef396 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:10:03 +1200 Subject: Adjust more .vimrc comments and whitespace --- vim/vimrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 4cf4b695..431a51c9 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -200,7 +200,7 @@ nnoremap ]c :cnext nnoremap [l :lprevious nnoremap ]l :lnext -" Insert blank lines above and below current line +" Insert blank lines around current line nmap [ PutBlankLinesAbove nmap ] PutBlankLinesBelow @@ -210,7 +210,7 @@ nnoremap gj j nnoremap k gk nnoremap gk k -" Remap Y to yank to end of line (consistent with C, D) +" Remap normal Y to yank to end of line (consistent with C, D) nnoremap Y y$ " ZA unconditionally writes all buffers @@ -287,7 +287,6 @@ endif " Disable core plugins I don't use if 1 - " I manage plugins myself with Git and a Makefile let g:loaded_getscriptPlugin = 1 let g:loaded_vimballPlugin = 1 @@ -303,7 +302,6 @@ if 1 let g:loaded_rrhelper = 1 " I don't need extra spelling files let g:loaded_spellfile_plugin = 1 - endif " Source any .vim files from ~/.vim/config -- cgit v1.2.3 From 8b6eae719fee4302796817e040d992629b456954 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:19:58 +1200 Subject: Handle visual mode better in Vim mappings --- vim/vimrc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 431a51c9..96023a77 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -175,17 +175,26 @@ if has('windows') endif -" Rebind normal to scroll down a page +" Rebind normal, visual to scroll down a page nnoremap +if v:version >= 700 + xnoremap +endif -" Rebind normal & to preserve substitution flags +" Rebind normal, visual & to preserve substitution flags nnoremap & :&& +if v:version >= 700 + xnoremap & :&& +endif " Stack insert Ctrl-C to undo the escaped insert operation inoremap u -" Stack normal Ctrl-L to clear search highlighting before redraw +" Stack normal, visual Ctrl-L to clear search highlight before redraw nnoremap :nohlsearch +if v:version >= 700 + xnoremap :nohlsearchgv +endif " Cycle through argument list nnoremap [a :previous -- cgit v1.2.3 From 5b06161ece5f72b3de4ad064ed62986a68ffc93f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:20:16 +1200 Subject: Remove j/gj remappings Mostly as an experiment; let's see how much I miss them. --- vim/vimrc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 96023a77..795bb8ce 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -213,12 +213,6 @@ nnoremap ]l :lnext nmap [ PutBlankLinesAbove nmap ] PutBlankLinesBelow -" Swap buffer line vs screen row motions -nnoremap j gj -nnoremap gj j -nnoremap k gk -nnoremap gk k - " Remap normal Y to yank to end of line (consistent with C, D) nnoremap Y y$ -- cgit v1.2.3 From daf5f6e93fd677be9ee2ddc50f3dbae5b3bbb96e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:21:51 +1200 Subject: Lean on defaults for Vim 'shortmess' --- vim/vimrc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 795bb8ce..6ef3cf8b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -94,21 +94,11 @@ set nrformats-=octal " Always tell me the number of lines changed by a command set report=0 -" Abbreviate some of the regularly displayed messages -set shortmess= -set shortmess+=f " (file 3 of 5) -> (3 of 5) -set shortmess+=i " [Incomplete last line] -> [noeol] +" Abbreviate some more regularly displayed messages set shortmess+=I " Don't show startup splash screen -set shortmess+=l " 999 lines, 888 characters -> 999L, 888C set shortmess+=m " [Modified] -> [+] -set shortmess+=n " [New File] -> [New] -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 middle if too long set shortmess+=w " written -> [w], appended -> [a] -set shortmess+=x " [dos format] -> [dos] " Show my current position in the status bar if has('cmdline_info') -- cgit v1.2.3 From a20b03254744564fc34097debaaf51ed2daf2295 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:40:20 +1200 Subject: Refine more .vimrc comments --- vim/vimrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 6ef3cf8b..0822ec49 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -76,7 +76,7 @@ set nojoinspaces " Don't redraw the screen during batch execution set lazyredraw -" Define list characters +" Define extra 'list' display characters set listchars+=extends:> " Unwrapped text to screen right set listchars+=precedes:< " Unwrapped text to screen left set listchars+=tab:>- " Tab characters, preserve width @@ -213,12 +213,12 @@ nnoremap ZW :write! " 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) + digraph ./ 8230 " HORIZONTAL ELLIPSIS U+2026 + digraph %% 8984 " PLACE OF INTEREST SIGN U+2318 (Mac command key) + digraph 8: 9731 " SNOWMAN U+2603 endif -" Use different keys for global and local leaders for plugins +" Use different keys for global and local leaders if 1 let g:mapleader = '\' let g:maplocalleader = '_' -- cgit v1.2.3 From 7da5ecbd23e7ece952c12fbb68f6a5d98aae7de2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:50:13 +1200 Subject: Remove 'fillchars' setting from .vimrc Unneeded --- vim/vimrc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 0822ec49..cb5f3119 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -157,12 +157,6 @@ if has('windows') if has('vertsplit') set splitright endif - - " Get rid of visually noisy folding characters - if has('folding') - let &fillchars = 'diff: ,fold: ,vert: ' - endif - endif " Rebind normal, visual to scroll down a page -- cgit v1.2.3 From 5654403461b6c1a86ba0ff059f2d9e387d62ab25 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:51:48 +1200 Subject: Document mode of Vim leader mappings --- vim/vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index cb5f3119..888542cf 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -218,8 +218,8 @@ if 1 let g:maplocalleader = '_' endif -" Leader mappings below; use a literal backslash rather than so that -" the non-plugin mappings work on vim-tiny +" Normal mode leader mappings below; use a literal backslash rather than +" so that the non-plugin mappings work on vim-tiny " \a toggles 'formatoptions' 'a' flag using a plugin nnoremap \a :ToggleOptionFlagLocal formatoptions a -- cgit v1.2.3 From def2aaa7119e53c53cf112a12e29c15489730c2c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:56:31 +1200 Subject: Remove 'tabstop' setting from .exrc --- ex/exrc | 1 - 1 file changed, 1 deletion(-) diff --git a/ex/exrc b/ex/exrc index 0c001f36..355b48ee 100644 --- a/ex/exrc +++ b/ex/exrc @@ -3,4 +3,3 @@ set autoindent set report=0 set shiftwidth=4 set showmode -set tabstop=4 -- cgit v1.2.3 From 9972fd4abb7ce2e182cae0cf61942e306514395f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 15:02:22 +1200 Subject: Bump VERSION 1.0.0 release! --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 157007d5..f7f1ff2f 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v0.59.0 -Thu Jun 21 21:54:12 UTC 2018 +tejr dotfiles v1.0.0 +Sat Jun 23 03:02:16 UTC 2018 -- cgit v1.2.3