diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-11-16 13:33:27 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-11-16 13:33:27 +1300 |
commit | 3c6c3020fbf750bfeddb8eaa627cb2e76738587b (patch) | |
tree | e88b00b7a5328cc1120b9f5c7094d89000c5718f /vim/vimrc | |
parent | Remove resolved issue (diff) | |
download | dotfiles-3c6c3020fbf750bfeddb8eaa627cb2e76738587b.tar.gz dotfiles-3c6c3020fbf750bfeddb8eaa627cb2e76738587b.zip |
Make Vim 'breakindent' subject to \b toggle
It impedes accurate copypasting from terminal emulators otherwise, which
is the main reason I implemented \b
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -117,11 +117,6 @@ endif " do clever things with indenting will often assume this is set set autoindent -" Indent broken lines -if v:version > 704 || v:version == 704 && has('patch338') - set breakindent -endif - " Use spaces instead of tabs set expandtab @@ -511,6 +506,9 @@ nnoremap k gk if has('linebreak') set linebreak set showbreak=... + if v:version > 704 || v:version == 704 && has('patch338') + set breakindent + endif " Bind \b to turn off linebreak and toggle the showbreak characters on and " off for convenience of copypasting multiple lines from terminal emulators. @@ -519,9 +517,15 @@ if has('linebreak') if &linebreak set nolinebreak set showbreak= + if v:version > 704 || v:version == 704 && has('patch338') + set nobreakindent + endif else set linebreak set showbreak=... + if v:version > 704 || v:version == 704 && has('patch338') + set breakindent + endif endif endfunction nnoremap <silent> <leader>b :<C-U>call ToggleBreak()<CR> |