aboutsummaryrefslogtreecommitdiff
path: root/vim/config/wrap.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-04 18:48:22 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-04 18:48:22 +1300
commit63087e57b8b1aa030b431b86f3be533ee20f07dc (patch)
treed9c129817e6e9722bdd8c559dc2f341991b68040 /vim/config/wrap.vim
parentMerge branch 'hotfix/v0.6.1' (diff)
parentUpdate dotfiles(7) manual from README.md (diff)
downloaddotfiles-0.7.0.tar.gz (sig)
dotfiles-0.7.0.zip
Merge branch 'release/v0.7.0'v0.7.0
* release/v0.7.0: (21 commits) Update dotfiles(7) manual from README.md Bump version number Add heading for Vim plugins subsection Update README to mention Vim plugins Rename toggle plugin again, use commands not funcs Add short documentation for new custom plugins Use same comment boilerplate for custom plugins Check 'eval' feature for loading command_typos.vim Wrap detect_background.vim func call in 'silent!' Rename and refactor option toggle plugin Don't suggest mappings in Vim plugin comments Move Vim background detection logic into plugin Specify an install-vim-autoload target Spin 'fo' toggle out into new flag toggler plugin Spin copyable linebreak config into new plugin Spin stable join config out into new plugin Use <Plug> prefix, make space strip configurable Rename a misnamed variable in big_file.vim Rename bigfile plugin to big_file Move trailing space strip config into plugin ...
Diffstat (limited to 'vim/config/wrap.vim')
-rw-r--r--vim/config/wrap.vim38
1 files changed, 4 insertions, 34 deletions
diff --git a/vim/config/wrap.vim b/vim/config/wrap.vim
index 7a442e89..5da843ce 100644
--- a/vim/config/wrap.vim
+++ b/vim/config/wrap.vim
@@ -23,42 +23,12 @@ if has('linebreak')
" Precede continued lines with '...'
set showbreak=...
- " If we have the option, indent wrapped lines as much as the first line;
- " keep the value as a script variable for the toggle function.
- let s:breakindent = v:version > 704
- \ || v:version ==# 704 && has('patch338')
- if s:breakindent
+ " If we have the option, indent wrapped lines as much as the first line
+ if has('&breakindent')
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.
- if has('eval')
+ " \b toggles copy-pasteable linebreak settings
+ nmap <leader>b <Plug>CopyLinebreak
- " Define function
- function! s:ToggleBreak()
-
- " If linebreak is on, turn it off
- if &l:linebreak
- setlocal nolinebreak linebreak?
- setlocal showbreak=
- if s:breakindent
- setlocal nobreakindent
- endif
-
- " If it's off, turn it on
- else
- setlocal linebreak linebreak?
- setlocal showbreak=...
- if s:breakindent
- setlocal breakindent
- endif
- endif
-
- endfunction
-
- " Map \b to defined function
- nnoremap <silent> <Leader>b :<C-U>call <SID>ToggleBreak()<CR>
-
- endif
endif