aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-05-31 10:29:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-05-31 10:29:52 +1200
commit307c4b58898222375686cc0712828420876d515f (patch)
treea583a97074242cb6acacde61928322633b79154d
parent8b579e948d20900df4957d30448be37dfc86ccef (diff)
downloaddotfiles-307c4b58898222375686cc0712828420876d515f.tar.gz
dotfiles-307c4b58898222375686cc0712828420876d515f.zip
Spin off copy_linebreak Vim plugin
-rw-r--r--.gitmodules3
-rw-r--r--Makefile7
m---------vim/bundle/copy_linebreak0
-rw-r--r--vim/doc/copy_linebreak.txt56
-rw-r--r--vim/plugin/copy_linebreak.vim68
5 files changed, 3 insertions, 131 deletions
diff --git a/.gitmodules b/.gitmodules
index 49355178..6bc0a4e9 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,4 +1,7 @@
# My Vim plugins
+[submodule "vim/bundle/copy_linebreak"]
+ path = vim/bundle/copy_linebreak
+ url = https://sanctum.geek.nz/code/vim-copy-linebreak.git
[submodule "vim/bundle/fixed_join"]
path = vim/bundle/fixed_join
url = https://sanctum.geek.nz/code/vim-fixed-join.git
diff --git a/Makefile b/Makefile
index 78bab07a..d73dcc84 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,6 @@
dist-vim-plugin-auto-undodir \
dist-vim-plugin-big-file-options \
dist-vim-plugin-command-typos \
- dist-vim-plugin-copy-linebreak \
dist-vim-plugin-mail-mutt \
dist-vim-plugin-strip-trailing-whitespace
@@ -668,7 +667,6 @@ dist-vim-plugin: dist-vim-plugin-auto-backupdir \
dist-vim-plugin-auto-undodir \
dist-vim-plugin-big-file-options \
dist-vim-plugin-command-typos \
- dist-vim-plugin-copy-linebreak \
dist-vim-plugin-mail-mutt \
dist-vim-plugin-strip-trailing-whitespace
@@ -697,11 +695,6 @@ dist-vim-plugin-command-typos: \
vim/doc/command_typos.txt \
VERSION
sh dist/vim-plugin.sh command_typos
-dist-vim-plugin-copy-linebreak: \
- vim/plugin/copy_linebreak.vim \
- vim/doc/copy_linebreak.txt \
- VERSION
- sh dist/vim-plugin.sh copy_linebreak
dist-vim-plugin-mail-mutt: \
vim/plugin/mail_mutt.vim \
vim/doc/mail_mutt.txt \
diff --git a/vim/bundle/copy_linebreak b/vim/bundle/copy_linebreak
new file mode 160000
+Subproject 3448f6ae2bc974af48fb16aaabff85fe1bc250e
diff --git a/vim/doc/copy_linebreak.txt b/vim/doc/copy_linebreak.txt
deleted file mode 100644
index 581c6166..00000000
--- a/vim/doc/copy_linebreak.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-*copy_linebreak.txt* For Vim version 7.0 Last change: 2017 November 12
-
-DESCRIPTION *copy_linebreak*
-
-This plugin provides mapping targets for a user to set, unset, or toggle
-|'linebreak'|-related settings when |'wrap'| is enabled, to switch between
-human-readable output and a format friendly for copy-pasting with terminal
-emulators or screen/tmux.
-
-REQUIREMENTS *copy_linebreak-requirements*
-
-This plugin is only available if 'compatible' is not set.
-
-MAPPINGS *copy_linebreak-mappings*
-
-Mapping targets provided are:
-
-|<Plug>CopyLinebreakEnable|: *<Plug>CopyLinebreakEnable*
- Enable copy-paste friendly line break options.
-|<Plug>CopyLinebreakDisable|: *<Plug>CopyLinebreakDisable*
- Revert to human-readable line break options.
-|<Plug>CopyLinebreakToggle|: *<Plug>CopyLinebreakToggle*
- Toggle between the above two states.
-
-There are no default key mappings to any of these targers; you should define
-them yourself in your |vimrc|. For example:
->
- :nmap <Leader>b <Plug>CopyLinebreakToggle
-<
-COMMANDS *copy_linebreak-commands*
-
-If the |+user_commands| feature is available, commands provided are:
-
-`:CopyLinebreakEnable`: *:CopyLinebreakEnable*
- Enable copy-paste friendly line break options.
-`:CopyLinebreakDisable`: *:CopyLinebreakDisable*
- Revert to human-readable line break options.
-`:CopyLinebreakToggle`: *:CopyLinebreakToggle*
- Toggle between the above two states.
-
-AUTHOR *copy_linebreak-author*
-
-Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
-
-LICENSE *copy_linebreak-license*
-
-Licensed for distribution under the same terms as Vim itself (see |license|).
-
-DISTRIBUTION *copy_linebreak-distribution*
-
-This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
-off into a separate distribution as it solidifies and this documentation
-improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
-information.
-
- vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/plugin/copy_linebreak.vim b/vim/plugin/copy_linebreak.vim
deleted file mode 100644
index a7d8a3e5..00000000
--- a/vim/plugin/copy_linebreak.vim
+++ /dev/null
@@ -1,68 +0,0 @@
-"
-" copy_linebreak.vim: Bind user-defined key sequences to toggle a group of
-" options that make text wrapped with 'wrap' copy-paste friendly. Also creates
-" user commands if it can.
-"
-" Author: Tom Ryder <tom@sanctum.geek.nz>
-" License: Same as Vim itself
-"
-if exists('g:loaded_copy_linebreak') || &compatible
- finish
-endif
-if !has('linebreak')
- finish
-endif
-let g:loaded_copy_linebreak = 1
-
-" Enable copy-friendly linebreak options
-function! s:CopyLinebreakEnable()
- setlocal nolinebreak linebreak?
- let s:showbreak_save = &showbreak
- set showbreak=
- if exists('+breakindent')
- setlocal nobreakindent
- endif
-endfunction
-
-" Disable copy-friendly linebreak options
-function! s:CopyLinebreakDisable()
- setlocal linebreak linebreak?
- let &showbreak = s:showbreak_save
- if exists('+breakindent')
- setlocal breakindent<
- endif
-endfunction
-
-" Toggle copy-friendly linebreak options, using the current setting for the
-" 'linebreak' option as the pivot
-function! s:CopyLinebreakToggle()
- if &linebreak
- call <SID>CopyLinebreakEnable()
- else
- call <SID>CopyLinebreakDisable()
- endif
-endfunction
-
-" Provide mappings to the function just defined
-noremap <silent> <unique>
- \ <Plug>CopyLinebreakEnable
- \ :<C-U>call <SID>CopyLinebreakEnable()<CR>
-noremap <silent> <unique>
- \ <Plug>CopyLinebreakDisable
- \ :<C-U>call <SID>CopyLinebreakDisable()<CR>
-noremap <silent> <unique>
- \ <Plug>CopyLinebreakToggle
- \ :<C-U>call <SID>CopyLinebreakToggle()<CR>
-
-" Provide user commands if we can
-if has('user_commands')
- command -nargs=0
- \ CopyLinebreakEnable
- \ call <SID>CopyLinebreakEnable
- command -nargs=0
- \ CopyLinebreakDisable
- \ call <SID>CopyLinebreakDisable
- command -nargs=0
- \ CopyLinebreakToggle
- \ call <SID>CopyLinebreakToggle
-endif