echo
echo " bin/get command-t #"
echo " bin/get ferret #"
- echo " bin/put pinnacle # freshen a specific downstream"
- echo " bin/put scalpel #"
+ echo " bin/put pinnacle #"
+ echo " bin/put scalpel # freshen a specific downstream"
echo " bin/put terminus #"
+ echo " bin/get vim-clipper #"
echo " bin/get vim-docvim #"
echo " ---------------------------------------------------"
echo " bin/get all # freshen all sources"
update pinnacle
update scalpel
update terminus
+ update vim-clipper
update vim-docvim
;;
- command-t|ferret|pinnacle|scalpel|terminus|vim-docvim)
+ command-t|ferret|pinnacle|scalpel|terminus|vim-clipper|vim-docvim)
update "$PROJECT"
;;
*)
echo
echo " bin/put command-t #"
echo " bin/put ferret #"
- echo " bin/put pinnacle # freshen a specific downstream"
- echo " bin/put scalpel #"
+ echo " bin/put pinnacle #"
+ echo " bin/put scalpel # freshen a specific downstream"
echo " bin/put terminus #"
+ echo " bin/get vim-clipper #"
echo " bin/put vim-docvim #"
echo " ---------------------------------------------------"
echo " bin/put all # freshen all downstreams"
update pinnacle
update scalpel
update terminus
+ update vim-clipper
update vim-docvim
;;
- command-t|ferret|pinnacle|scalpel|terminus|vim-docvim)
+ command-t|ferret|pinnacle|scalpel|terminus|vim-clipper|vim-docvim)
update "$PROJECT"
;;
*)
--- /dev/null
+Project
+ [ Project
+ [ Unit
+ [ FunctionDeclaration
+ { functionBang = True
+ , functionName = "clipper#private#clip"
+ , functionArguments = ArgumentList []
+ , functionAttributes = [ "abort" ]
+ , functionBody =
+ [ GenericStatement "if executable('nc') == 1"
+ , LetStatement
+ { letLexpr = "l:address "
+ , letValue = "get(g:, 'ClipperAddress', 'localhost')"
+ }
+ , LetStatement
+ { letLexpr = "l:port "
+ , letValue =
+ "+(get(g:, 'ClipperPort', 8377)) \" Co-erce to number."
+ }
+ , GenericStatement "if l:port"
+ , GenericStatement
+ "call system('nc ' . l:address . ' ' . l:port, @0)"
+ , GenericStatement "else"
+ , GenericStatement "call system('nc -U ' . l:address, @0)"
+ , GenericStatement "endif"
+ , GenericStatement "else"
+ , GenericStatement
+ "echoerr 'Clipper: nc executable does not exist'"
+ , GenericStatement "endif"
+ ]
+ }
+ ]
+ , Unit
+ [ GenericStatement
+ "if exists('g:ClipperLoaded') || &compatible || v:version < 700"
+ , GenericStatement "finish"
+ , GenericStatement "endif"
+ , LetStatement { letLexpr = "g:ClipperLoaded" , letValue = "1" }
+ , LetStatement
+ { letLexpr = "s:cpoptions" , letValue = "&cpoptions" }
+ , GenericStatement "set cpoptions&vim"
+ , GenericStatement "command! Clip call clipper#private#clip()"
+ , LetStatement
+ { letLexpr = "s:map" , letValue = "get(g:, 'ClipperMap', 1)" }
+ , GenericStatement "if s:map"
+ , GenericStatement
+ "if !hasmapto('<Plug>(ClipperClip)') && maparg('<leader>y', 'n') ==# ''"
+ , GenericStatement "nmap <unique> <leader>y <Plug>(ClipperClip)"
+ , GenericStatement "endif"
+ , GenericStatement "endif"
+ , GenericStatement "nnoremap <Plug>(ClipperClip) :Clip<CR>"
+ , LetStatement
+ { letLexpr = "&cpoptions" , letValue = "s:cpoptions" }
+ , UnletStatement { unletBang = False , unletBody = "s:cpoptions" }
+ ]
+ ]
+ ]
--- /dev/null
+Copyright 2015-present Greg Hurrell. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
--- /dev/null
+doc/clipper.txt
\ No newline at end of file
--- /dev/null
+" Copyright 2015-present Greg Hurrell. All rights reserved.
+" Licensed under the terms of the BSD 2-clause license.
+
+function! clipper#private#clip() abort
+ if executable('nc') == 1
+ let l:address = get(g:, 'ClipperAddress', 'localhost')
+ let l:port = +(get(g:, 'ClipperPort', 8377)) " Co-erce to number.
+ if l:port
+ call system('nc ' . l:address . ' ' . l:port, @0)
+ else
+ call system('nc -U ' . l:address, @0)
+ endif
+ else
+ echoerr 'Clipper: nc executable does not exist'
+ endif
+endfunction
--- /dev/null
+" Copyright 2015-present Greg Hurrell. All rights reserved.
+" Licensed under the terms of the BSD 2-clause license.
+
+" Provide users with means to prevent loading, as recommended in `:h
+" write-plugin`.
+if exists('g:ClipperLoaded') || &compatible || v:version < 700
+ finish
+endif
+let g:ClipperLoaded=1
+
+" Temporarily set 'cpoptions' to Vim default as per `:h use-cpo-save`.
+let s:cpoptions=&cpoptions
+set cpoptions&vim
+
+command! Clip call clipper#private#clip()
+
+let s:map=get(g:, 'ClipperMap', 1)
+if s:map
+ if !hasmapto('<Plug>(ClipperClip)') && maparg('<leader>y', 'n') ==# ''
+ nmap <unique> <leader>y <Plug>(ClipperClip)
+ endif
+endif
+nnoremap <Plug>(ClipperClip) :Clip<CR>
+
+" Restore 'cpoptions' to its former value.
+let &cpoptions=s:cpoptions
+unlet s:cpoptions