From 307c4b58898222375686cc0712828420876d515f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 31 May 2018 10:29:52 +1200 Subject: Spin off copy_linebreak Vim plugin --- .gitmodules | 3 ++ Makefile | 7 ----- vim/bundle/copy_linebreak | 1 + vim/doc/copy_linebreak.txt | 56 ----------------------------------- vim/plugin/copy_linebreak.vim | 68 ------------------------------------------- 5 files changed, 4 insertions(+), 131 deletions(-) create mode 160000 vim/bundle/copy_linebreak delete mode 100644 vim/doc/copy_linebreak.txt delete mode 100644 vim/plugin/copy_linebreak.vim 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 index 00000000..3448f6ae --- /dev/null +++ b/vim/bundle/copy_linebreak @@ -0,0 +1 @@ +Subproject commit 3448f6ae2bc974af48fb16aaabff85fe1bc250e5 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: - -|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. - -There are no default key mappings to any of these targers; you should define -them yourself in your |vimrc|. For example: -> - :nmap b 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 . - -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 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 -" 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 CopyLinebreakEnable() - else - call CopyLinebreakDisable() - endif -endfunction - -" Provide mappings to the function just defined -noremap - \ CopyLinebreakEnable - \ :call CopyLinebreakEnable() -noremap - \ CopyLinebreakDisable - \ :call CopyLinebreakDisable() -noremap - \ CopyLinebreakToggle - \ :call CopyLinebreakToggle() - -" Provide user commands if we can -if has('user_commands') - command -nargs=0 - \ CopyLinebreakEnable - \ call CopyLinebreakEnable - command -nargs=0 - \ CopyLinebreakDisable - \ call CopyLinebreakDisable - command -nargs=0 - \ CopyLinebreakToggle - \ call CopyLinebreakToggle -endif -- cgit v1.2.3