aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-09-04 11:46:26 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-09-04 11:46:26 +1200
commit8026190c39d8cecdd7179cb1db35e0c72c1f4340 (patch)
tree6a3c49871876d9696bc8e8341e5f62d89d74f2c7
parentMerge branch 'release/v1.65.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-8026190c39d8cecdd7179cb1db35e0c72c1f4340.tar.gz
dotfiles-8026190c39d8cecdd7179cb1db35e0c72c1f4340.zip
Merge branch 'release/v1.66.0'v1.66.0
* release/v1.66.0: Bump VERSION Comment to explain \c,\C mappings Use \_ as Vim text object for `[,`] marks Remove visual_block_suspend_wrap.vim
-rw-r--r--VERSION4
-rw-r--r--vim/plugin/visual_block_suspend_wrap.vim43
-rw-r--r--vim/vimrc7
3 files changed, 7 insertions, 47 deletions
diff --git a/VERSION b/VERSION
index e1e9348a..4f8ec31c 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v1.65.0
-Thu Aug 30 01:55:50 UTC 2018
+tejr dotfiles v1.66.0
+Mon Sep 3 23:46:26 UTC 2018
diff --git a/vim/plugin/visual_block_suspend_wrap.vim b/vim/plugin/visual_block_suspend_wrap.vim
deleted file mode 100644
index 75b87060..00000000
--- a/vim/plugin/visual_block_suspend_wrap.vim
+++ /dev/null
@@ -1,43 +0,0 @@
-"
-" visual_block_suspend_wrap.vim: If 'wrap' is enabled, switch it off after the
-" first movement in visual block mode, and put it back after the first
-" movement after it's left. My kingdom for a VisualEnter event...
-"
-if exists('g:visual_block_suspend_wrap') || &compatible
- finish
-endif
-if !exists('##CursorMoved')
- finish
-endif
-let g:loaded_visual_block_suspend_wrap = 1
-
-" Flag for whether we've suspended 'wrap'
-let s:wrap_suspended = 0
-
-" Function for checking mode and suspending or restoring 'wrap', if applicable
-function! s:Check() abort
-
- " If this is visual block mode...
- if mode() ==# "\<C-V>"
-
- " ...and 'wrap' is set, suspend it and flag that we did.
- if &wrap
- setlocal nowrap
- let s:wrap_suspended = 1
- endif
-
- " If it's some other mode, and we've suspended 'wrap' and it's not on,
- " switch it back on and clear the flag
- elseif s:wrap_suspended && !&wrap
- setlocal wrap
- let s:wrap_suspended = 0
- endif
-
-endfunction
-
-" Check the mode after each CursorMoved event, because there isn't a way to
-" check for entering or leaving visual mode specifically
-augroup visual_block_suspend_wrap
- autocmd!
- autocmd CursorMoved * call s:Check()
-augroup END
diff --git a/vim/vimrc b/vim/vimrc
index caa52867..3eb6236f 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -255,9 +255,9 @@ nnoremap <Bslash>a :<C-U>ToggleFlagLocal formatoptions a<CR>
" \b toggles copy-pasteable linebreak settings
nmap <Bslash>b <Plug>(CopyLinebreakToggle)
-" \c toggles 'cursorline'
+" \c toggles 'cursorline'; no visual mode map as it doesn't work
nnoremap <Bslash>c :<C-U>setlocal cursorline! cursorline?<CR>
-" \C toggles 'cursorcolumn'
+" \C toggles 'cursorcolumn'; works in visual mode
nnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>
if exists(':xnoremap')
xnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv
@@ -389,6 +389,9 @@ nnoremap <Bslash>. :<C-U>lmake!<CR>
nnoremap <Bslash><lt> :<C-U>'[,']<lt><CR>
nnoremap <Bslash>> :<C-U>'[,']><CR>
+" \_ uses last changed or yanked text as an object
+onoremap <Bslash>_ :<C-U>normal! `[v`]<CR>
+
" \{ and \} move to lines with non-space chars before current column
nmap <Bslash>{ <Plug>(VerticalRegionUpNormal)
nmap <Bslash>} <Plug>(VerticalRegionDownNormal)