From 670a985f009f23f67e6f08ebbd4f1eb38468d5bf Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 2 Apr 2015 14:52:03 +1300 Subject: Binding for copypaste convenience --- vim/vimrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'vim') 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 b :call ToggleBreak() + endif endif " I really like ZZ and ZQ, so I wrote a couple more mappings; ZW forces a -- cgit v1.2.3