*fakeclip.txt* pseudo clipboard register for non-GUI version of Vim Version 0.2.10 Script ID: 2098 Copyright (C) 2007-2012 Kana Natsuno License: So-called MIT/X license {{{ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. }}} CONTENTS *fakeclip-contents* Introduction |fakeclip-introduction| Interface |fakeclip-interface| Key Mappings |fakeclip-key-mappings| Variables |fakeclip-variables| Bugs |fakeclip-bugs| Changelog |fakeclip-changelog| ============================================================================== INTRODUCTION *fakeclip-introduction* *fakeclip* is a Vim plugin to provide a pseudo |clipboard| register for several versions of Vim without |+clipboard| support, especially for non-GUI version of Vim on the following platforms: - Cygwin - Mac OS X - X Window System (by xclip ) fakeclip also provides a pseudo register to access a "paste buffer" if one of the following applications is available: - GNU screen - tmux FAQ: If you can't copy/paste multibyte characters with the clipboard on Mac OS X, see |fakeclip-multibyte-on-mac|. Note for Mac OS users: Though Vim supports clipboard for the console version since version 7.3, fakeclip is still useful to access a "paste buffer". Requirements: - Vim 7.0 or later Latest version: http://github.com/kana/vim-fakeclip Document in HTML format: http://kana.github.com/config/vim/fakeclip.html ============================================================================== INTERFACE *fakeclip-interface* ------------------------------------------------------------------------------ KEY MAPPINGS *fakeclip-key-mappings* [count](fakeclip-y){motion} *(fakeclip-y)* [count](fakeclip-Y) *(fakeclip-Y)* {Visual}(fakeclip-y) *v_(fakeclip-y)* {Visual}(fakeclip-Y) *v_(fakeclip-Y)* Like |y| or |Y|, but yank into the clipboard. [count](fakeclip-d){motion} *(fakeclip-d)* [count](fakeclip-dd) *(fakeclip-dd)* [count](fakeclip-D) *(fakeclip-D)* {Visual}(fakeclip-d) *v_(fakeclip-d)* {Visual}(fakeclip-D) *v_(fakeclip-D)* Like |d|, |dd| or |D|, but cut into the clipboard. [count](fakeclip-p) *(fakeclip-p)* [count](fakeclip-P) *(fakeclip-P)* [count](fakeclip-gp) *(fakeclip-gp)* [count](fakeclip-gP) *(fakeclip-gP)* [count](fakeclip-]p) *(fakeclip-]p)* [count](fakeclip-]P) *(fakeclip-]P)* [count](fakeclip-[p) *(fakeclip-[p)* [count](fakeclip-[P) *(fakeclip-[P)* Like |p|, |P|, |gp|, |gP|, |]p|, |]P|, |[p| or |[P|, but put from the clipboard. *c_(fakeclip-insert)* (fakeclip-insert) *i_(fakeclip-insert)* *c_(fakeclip-insert-r)* (fakeclip-insert-r) *i_(fakeclip-insert-r)* *c_(fakeclip-insert-o)* (fakeclip-insert-o) *i_(fakeclip-insert-o)* (fakeclip-insert-p) *i_(fakeclip-insert-p)* Like |i_CTRL-R|, |i_CTRL-R_CTRL-R|, |i_CTRL-R_CTRL-O|, |i_CTRL-R_CTRL-P|, |c_CTRL-R|, |c_CTRL-R_CTRL-R| or |c_CTRL-R_CTRL-O|, but insert the content of the clipboard. [count](fakeclip-screen-y){motion} *(fakeclip-screen-y)* [count](fakeclip-screen-Y) *(fakeclip-screen-Y)* {Visual}(fakeclip-screen-y) *v_(fakeclip-screen-y)* {Visual}(fakeclip-screen-Y) *v_(fakeclip-screen-Y)* Like |y| or |Y|, but yank into the paste buffer. [count](fakeclip-screen-d){motion} *(fakeclip-screen-d)* [count](fakeclip-screen-dd) *(fakeclip-screen-dd)* [count](fakeclip-screen-D) *(fakeclip-screen-D)* {Visual}(fakeclip-screen-d) *v_(fakeclip-screen-d)* {Visual}(fakeclip-screen-D) *v_(fakeclip-screen-D)* Like |d|, |dd| or |D|, but cut into the pastebuffer. [count](fakeclip-screen-p) *(fakeclip-screen-p)* [count](fakeclip-screen-P) *(fakeclip-screen-P)* [count](fakeclip-screen-gp) *(fakeclip-screen-gp)* [count](fakeclip-screen-gP) *(fakeclip-screen-gP)* [count](fakeclip-screen-]p) *(fakeclip-screen-]p)* [count](fakeclip-screen-]P) *(fakeclip-screen-]P)* [count](fakeclip-screen-[p) *(fakeclip-screen-[p)* [count](fakeclip-screen-[P) *(fakeclip-screen-[P)* Like |p|, |P|, |gp|, |gP|, |]p|, |]P|, |[p| or |[P|, but put from the paste buffer. *c_(fakeclip-screen-insert)* (fakeclip-screen-insert) *i_(fakeclip-screen-insert)* *c_(fakeclip-screen-insert-r)* (fakeclip-screen-insert-r) *i_(fakeclip-screen-insert-r)* *c_(fakeclip-screen-insert-o)* (fakeclip-screen-insert-o) *i_(fakeclip-screen-insert-o)* (fakeclip-screen-insert-p) *i_(fakeclip-screen-insert-p)* Like |i_CTRL-R|, |i_CTRL-R_CTRL-R|, |i_CTRL-R_CTRL-O|, |i_CTRL-R_CTRL-P|, |c_CTRL-R|, |c_CTRL-R_CTRL-R| or |c_CTRL-R_CTRL-O|, but insert the content of the paste buffer. *g:fakeclip_no_default_key_mappings* *:FakeclipDefaultKeyMappings* Fakeclip will define the following key mappings. If you don't want to define these default key mappings, define |g:fakeclip_no_default_key_mappings| before this plugin is loaded (e.g. in your |vimrc|). You can also use |:FakeclipDefaultKeyMappings| to redefine these key mappings. This command doesn't override existing {lhs}s unless [!] is given. modes {lhs} {rhs} ~ ----- ----------- -------------------------------- ~ nv "+y (fakeclip-y) nv "*y (fakeclip-y) n "+yy (fakeclip-Y) n "*yy (fakeclip-Y) nv "+Y (fakeclip-Y) nv "*Y (fakeclip-Y) nv "+d (fakeclip-d) nv "*d (fakeclip-d) n "+dd (fakeclip-dd) n "*dd (fakeclip-dd) nv "+D (fakeclip-D) nv "*D (fakeclip-D) nv "+p (fakeclip-p) nv "*p (fakeclip-p) nv "+P (fakeclip-P) nv "*P (fakeclip-P) nv "+gp (fakeclip-gp) nv "*gp (fakeclip-gp) nv "+gP (fakeclip-gP) nv "*gP (fakeclip-gP) nv "+]p (fakeclip-]p) nv "*]p (fakeclip-]p) nv "+]P (fakeclip-]P) nv "*]P (fakeclip-]P) nv "+[p (fakeclip-[p) nv "*[p (fakeclip-[p) nv "+[P (fakeclip-[P) nv "*[P (fakeclip-[P) ic + (fakeclip-insert) ic * (fakeclip-insert) ic + (fakeclip-insert-r) ic * (fakeclip-insert-r) ic + (fakeclip-insert-o) ic * (fakeclip-insert-o) i + (fakeclip-insert-p) i * (fakeclip-insert-p) nv "&y (fakeclip-screen-y) n "&yy (fakeclip-screen-Y) nv "&Y (fakeclip-screen-Y) nv "&d (fakeclip-screen-d) n "&dd (fakeclip-screen-dd) nv "&D (fakeclip-screen-D) nv "&p (fakeclip-screen-p) nv "&P (fakeclip-screen-P) nv "&gp (fakeclip-screen-gp) nv "&gP (fakeclip-screen-gP) nv "&]p (fakeclip-screen-]p) nv "&]P (fakeclip-screen-]P) nv "&[p (fakeclip-screen-[p) nv "&[P (fakeclip-screen-[P) ic & (fakeclip-screen-insert) ic & (fakeclip-screen-insert-r) ic & (fakeclip-screen-insert-o) i & (fakeclip-screen-insert-p) ------------------------------------------------------------------------------ VARIABLES *fakeclip-variables* g:fakeclip_no_default_key_mappings See |g:fakeclip_no_default_key_mappings|. g:fakeclip_terminal_multiplexer_type *g:fakeclip_terminal_multiplexer_type* A string to specify your favorite terminal multiplexer. One of the following values can be specified: "gnuscreen" Use GNU screen. "tmux" Use tmux. "unknown" Use no terminal multiplexer. The default value is determined as follows: 1. "tmux" will be used if Vim is running in a tmux session. 2. "gnuscreen" will be used if Vim is running in a GNU screen session. 3. User-defined value (via |vimrc| etc) will be used if both tmux and GNU screen are installed. "tmux" will be used if user does not define the value. 4. "tmux" will be used if only tmux is installed. 5. "gnuscreen" will be used if only GNU screen is installed. 6. "unknown" will be used otherwise. ============================================================================== BUGS *fakeclip-bugs* (a) This plugin just provide pseudo clipboard register for ordinary editing. So |getreg()|, |setreg()|, |expr-register| and other interface on clipboard register are not supported. (b) The characteristic (i.e., characterwise, linewise or blockwise) of the clipboard content is not remembered. It will be linewise if each line of the clipboard content ends with a newline, otherwise it will be characterwise. (c) Executing (fakeclip-y) in Normal mode, the display of 'showcmd' is different from the ordinary one. (d) (fakeclip-y) in Normal mode doesn't accept "y" as a linewise {motion} like the built-in |y|. *fakeclip-multibyte-on-mac* (e) On Mac OS X, you have to set a proper value to the environment variable __CF_USER_TEXT_ENCODING. It contins :-separated values: - The 1st value means a user id. It must be the same as the result of the following command: > printf '0x%X\n' `id -u` < - The 2nd value means the character encoding which is used to translate string data between GUI and Terminal. For example, if you work on Terminal with UTF-8, the 2nd value of __CF_USER_TEXT_ENCODING must be set to "0x08000100". See the following URI for the magic values to specify character encodings: http://developer.apple.com/documentation/CoreFoundation/Reference/CFStringRef/ For example, the valaue of __CF_USER_TEXT_ENCODING on the author's environment is as follows: > 0x1F5:0x08000100:0 < (f) On Mac OS X, if you use Vim on GNU screen and you can't copy/paste text with the clipboard, try installing GNU screen from MacPorts with "+darwin" variants. (g) There is a race condition problem to read the paste buffer of GNU screen. ============================================================================== CHANGELOG *fakeclip-changelog* 0.2.10 2012-01-22T01:50:21+09:00 *fakeclip-changelog-0.2.10* - Improve the detection of terminal multiplexers. In other words, (a) use a more suitable one according to the current environment; (b) support using the pastebuffer from Vim not in a tmux session. See also |g:fakeclip_terminal_multiplexer_type| for the details. (Thanks m4i for reporting the problem via https://github.com/kana/vim-fakeclip/pull/5) 0.2.9 2011-10-07T20:50:58+09:00 *fakeclip-changelog-0.2.9* - Add support for |d|, |dd| and |D| operation for the clipboard and the pastebuffer. (Thanks for Suan-Aik Yeo) 0.2.8 2010-08-31T20:19:51+09:00 *fakeclip-changelog-0.2.8* - |:FakeclipDefaultKeyMappings|: Fix to regard a given bang. 0.2.7 2010-04-02T21:27:16+09:00 *fakeclip-changelog-0.2.7* - Fix to read/write the paste buffer of GNU screen outside a session. Old versions allow to read/write the paste buffer only if Vim is running in a session of GNU screen. 0.2.6 2009-11-16T20:49:35+09:00 *fakeclip-changelog-0.2.6* - Fix improper error message on putting to paste buffer. (Thanks to @thinca for reporting) - Fix a bug that there is a possibility to fail to read the paste buffer of GNU screen if it is emptied by "register . ''". (Thanks to @thinca for reporting) - Revise for race condition problem to read the paste buffer of GNU screen, though it's not perfect yet. 0.2.5 2009-11-11T21:51:50+09:00 *fakeclip-changelog-0.2.5* - Revise the way to detect whether GNU screen is available or not. - Fix a bug to yank to string with newline character into paste buffer register. - Support X Window System by xclip. (Thanks for @thinca) - Support tmux. (Thanks for @thinca) 0.2.4 2009-06-13T18:22:01+09:00 *fakeclip-changelog-0.2.4* - Revise on platforms where |+clipboard| is available: - Define all stuffs such as |fakeclip-key-mappings| on all platforms. Without this, the pseudo register for GNU screen's paste buffer is not available if |+clipboard| is available. - |:FakeclipDefaultKeyMappings|: Don't define the default key mappings for clipboard to avoid confusion with the built-in key mappings. For example, "*y and "+y are not mapped to |(fakeclip-y)|. 0.2.3 2009-05-06T03:03:25+09:00 *fakeclip-changelog-0.2.3* - Revise the documents on Mac OS X specific problems. See |fakeclip-multibyte-on-mac| if you can't copy/paste with the clipboard on Mac OS X. - Fix a bug that fakeclip uses wrong function to escape file-like arguments to shells. Thanks @thinca for reporting this. 0.2.2 2009-03-25T21:17:25+09:00 *fakeclip-changelog-0.2.2* - Add equivalents for the following commands: |]p|, |]P|, |[p|, |[P|, |i_CTRL-R_CTRL-R|, |i_CTRL-R_CTRL-O|, |i_CTRL-R_CTRL-P|, |c_CTRL-R_CTRL-R|, |c_CTRL-R_CTRL-O|. - Fix the way to detect the current platform. For Mac OS X, it depended on some assumptions. Thanks for someone who wrote about this bug at the Vim Tips Wiki. 0.2.1 2008-10-24T16:18:32+09:00 *fakeclip-changelog-0.2.1* - Refactor. - Support the paste buffer of GNU screen as a pseudo register. 0.2.0 2008-07-14T14:09:49+09:00 *fakeclip-changelog-0.2.0* - Rename as "fakeclip" (the old name is "cygclip"). - Support Mac OS X. - Autoloaded. 0.1 2007-12-27T22:47:34+09:00 *fakeclip-changelog-0.1* - Modify to automatically define the default key mappings as this plugin is loaded. See |g:fakeclip_no_default_key_mappings| for how to suppress this behavior. 0.0 2007-08-13 *fakeclip-changelog-0.0* - First release. ============================================================================== vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker: