aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:49:01 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:52:10 +1300
commitce7003bd7fa173ccfb1552b42ca4250176d3ebb2 (patch)
tree2659921212c3f0840e903b14be0800502e4946ea
parentMove windows .vimrc config into subfile (diff)
downloaddotfiles-ce7003bd7fa173ccfb1552b42ca4250176d3ebb2.tar.gz
dotfiles-ce7003bd7fa173ccfb1552b42ca4250176d3ebb2.zip
Move linebreak .vimrc config into subfile
I'm not quite so sure about this one. The ToggleBreak() function might actually be better in a plugin on its own. The rest of it makes sense though.
-rw-r--r--vim/config/linebreak.vim31
-rw-r--r--vim/vimrc32
2 files changed, 31 insertions, 32 deletions
diff --git a/vim/config/linebreak.vim b/vim/config/linebreak.vim
new file mode 100644
index 00000000..887d5f39
--- /dev/null
+++ b/vim/config/linebreak.vim
@@ -0,0 +1,31 @@
+" Break lines at word boundaries if possible and not simply at the last
+" character that will fit on the screen, preceding the next line with three
+" periods to make it obvious that it's a continuation of the previous line
+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.
+ if has('eval')
+ function! ToggleBreak()
+ 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>
+ endif
+endif
diff --git a/vim/vimrc b/vim/vimrc
index 19dbd482..f4678bb9 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -254,38 +254,6 @@ set shellpipe=>
nnoremap j gj
nnoremap k gk
-" Break lines at word boundaries if possible and not simply at the last
-" character that will fit on the screen, preceding the next line with three
-" periods to make it obvious that it's a continuation of the previous line
-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.
- if has('eval')
- function! ToggleBreak()
- 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>
- endif
-endif
-
" I really like ZZ and ZQ, so I wrote a couple more mappings; ZW forces a
" write of the current buffer, but doesn't quit, and ZA forces a write of all
" buffers but doesn't quit