aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-04-02 14:52:03 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-04-02 14:52:03 +1300
commit670a985f009f23f67e6f08ebbd4f1eb38468d5bf (patch)
tree94b0ba71b8a905c4f26941e48947059d0752e6e2 /vim/vimrc
parentComplete cf function with dir names (diff)
downloaddotfiles-670a985f009f23f67e6f08ebbd4f1eb38468d5bf.tar.gz
dotfiles-670a985f009f23f67e6f08ebbd4f1eb38468d5bf.zip
Binding for copypaste convenience
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc15
1 files changed, 15 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index b5d73878..60025bfb 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -522,6 +522,21 @@ nnoremap k gk
if has('linebreak')
set linebreak
set showbreak=...
+
+ " Bind \b to turn off linebreak and toggle the showbreak characters on and
+ " off for convenience of copypasting multiple lines from terminal emulators.
+ if has('eval')
+ function! ToggleBreak()
+ if &linebreak
+ set nolinebreak showbreak=
+ set showbreak=
+ else
+ set linebreak
+ set showbreak=...
+ endif
+ endfunction
+ nnoremap <silent> <leader>b :<C-U>call ToggleBreak()<CR>
+ endif
endif
" I really like ZZ and ZQ, so I wrote a couple more mappings; ZW forces a