aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc56
1 files changed, 32 insertions, 24 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 94af80f6..5f820fe4 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -652,8 +652,8 @@ endif
set hidden
" Do highlight matches for completed searches in the text, but clear that
-" highlighting away when this vimrc is reload. Later on in this file, CTRL-L
-" in normal mode is remapped to tack on a :nohlsearch as well.
+" highlighting away when this vimrc is reloaded. Later on in this file,
+" CTRL-L in normal mode is remapped to tack on a :nohlsearch as well.
"
set hlsearch
nohlsearch
@@ -707,8 +707,8 @@ set listchars+=nbsp:+ " Non-breaking spaces
" The next pair of 'list' characters are arguably somewhat misplaced, in that
" they don't really represent invisible characters in the same way as the
-" others, but are hints for the presence of other characters unwrapped lines
-" that are wider than the screen. They're very useful, though.
+" others, but are hints for the presence of other characters on unwrapped
+" lines that are wider than the screen. They're very useful, though.
"
" If the current encoding supports it, use these non-ASCII characters for the
" markers, as they're visually distinctive:
@@ -721,9 +721,9 @@ set listchars+=nbsp:+ " Non-breaking spaces
" Failing that, '<' and '>' will still do the trick.
"
if has('multi_byte_encoding')
- set listchars+=extends:» listchars+=precedes:«
+ set listchars+=extends:»,precedes:«
else
- set listchars+=extends:> listchars+=precedes:<
+ set listchars+=extends:>,precedes:<
endif
" Don't let your editor's options be configured by content in arbitrary files!
@@ -777,6 +777,14 @@ set sessionoptions-=options " No global options or mappings
"
set shortmess+=I
+" I find the defaults of new windows opening above or to the left of the
+" previous window too jarring, because I'm used to both the i3 window manager
+" and the tmux terminal multiplexer doing it the other way around, in reading
+" order. I prefer the visual effect of the previous text staying where it is,
+" and the new window occupying previously blank space.
+"
+set splitbelow splitright
+
" Limit the number of characters per line that syntax highlighting will
" attempt to match. This is as much an effort to encourage me to break long
" lines and do hard wrapping correctly as it is for efficiency.
@@ -852,12 +860,12 @@ set wildmode=list:longest,full
" candidates for tab completion on the command line.
"
" To make this list, I went right through my home directory with
-" a `find`-toothed comb, counted the occurrences of every extension, forced
+" a `find`-toothed comb; counted the occurrences of every extension, forced
" down to lowercase; and then manually selected the ones that I was confident
" would seldom contain plain text.
"
-" This does the trick with POSIX-compatible shell tools, giving you patterns
-" for the top 50 extensions:
+" The following incantation does the trick with POSIX-compatible shell tools,
+" giving you patterns for the top 50 extensions:
"
" $ find ~ -type f -name '*.*' |
" awk -F. '{exts[tolower($NF)]++}
@@ -958,9 +966,9 @@ endtry
" &filetype and set up by ftplugin files.
"
" * If a normal mode map would make sense in visual mode, take the time to
-" configure that too. Use :xmap and its analogues rather :vmap to avoid
-" defining unusable select-mode mappings, even though I never actually use
-" selection mode directly.
+" configure that too. Use :xmap and its analogues rather than :vmap to
+" avoid defining unusable select-mode mappings, even though I never actually
+" use selection mode directly.
"
" * Avoid mapping in insert mode; let characters be literal to the greatest
" extent possible, and avoid "doing more" in insert mode besides merely
@@ -1088,7 +1096,7 @@ imap <C-K><C-K> <Plug>(DigraphSearch)
" issuing a :nohlsearch command to stop highlighting searches on top of this.
"
" This gets by far the most use in normal mode, but I'd like it to work in
-" visual and insert mode, too, where it's occasionally useful, especially on
+" insert and visual modes, too, where it's occasionally useful, especially on
" things like mobile phone terminal emulators that can be choppy and require
" a lot of redrawing.
"
@@ -1098,19 +1106,20 @@ imap <C-K><C-K> <Plug>(DigraphSearch)
nnoremap <C-L>
\ :<C-U>nohlsearch<CR><C-L>
-" We use :vnoremap rather than :xnoremap and thereby make the mapping apply to
-" select mode as well, because CTRL-L doesn't reflect a printable character,
-" and so we may as well, even though I never use select mode directly.
+" The insert mode wrapper for normal CTRL-L uses CTRL-O to issue a single
+" normal mode command. We intentionally use `:normal` rather than `:normal!`
+" so that the normal mode mapping applies. I tried using just <C-O><C-L>
+" directly for this, but it didn't work; maybe i_CTRL-O doesn't respect
+" mappings, but I couldn't find any documentation about this.
"
-vnoremap <C-L>
- \ :<C-U>nohlsearch<CR>gv<C-L>
+inoremap <C-L> <C-O>:normal "\<C-L>"<CR>
-" The insert mode mapping uses CTRL-O to issue a single normal normal-mode
-" command, but twice: once to issue the :nohlsearch command, and then once to
-" issue an unmapped normal-mode CTRL-L.
+" We use :vnoremap here rather than :xnoremap and thereby make the mapping
+" apply to select mode as well, because CTRL-L doesn't reflect a printable
+" character, and so we may as well make it work, even though I don't actually
+" use select mode directly.
"
-inoremap <C-L>
- \ <C-O>:<C-U>nohlsearch<CR><C-O><C-L>
+vmap <C-L> <Esc><C-L>gv
" By default, the very-useful normal mode command '&' that repeats the
" previous :substitute command doesn't preserve the flags from that
@@ -1382,7 +1391,6 @@ nnoremap <Leader>j
" :SqueezeRepeatBlanks
" keep_position.vim
" :KeepPosition
-"
"" Leader,x strips trailing whitespace via a custom plugin
nnoremap <Leader>x