*operator-replace.txt*  Operator to replace text with register content

Version 0.0.1
Script ID: 2782
Copyright (C) 2009 kana <http://whileimautomaton.net/>
License: MIT 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                                        *operator-replace-contents*

Introduction            |operator-replace-introduction|
Interface               |operator-replace-interface|
  Key Mappings            |operator-replace-key-mappings|
Examples                |operator-replace-examples|
Bugs                    |operator-replace-bugs|
Changelog               |operator-replace-changelog|




==============================================================================
INTRODUCTION                                   *operator-replace-introduction*

*operator-replace* is a Vim plugin to provide an operator to replace
a specified text with register content.  This is shortcut for several types of
operations such as "d{motion}P" and "c{motion}<C-r>{register}".


Requirements:
- Vim 7.2 or later
- |operator-user| 0.0.5 or later (vimscript#2692)

Latest version:
http://github.com/kana/config/commits/vim-operator-replace

Document in HTML format:
http://kana.github.com/config/vim/operator-replace.html




==============================================================================
INTERFACE                                       *operator-replace-interface*

------------------------------------------------------------------------------
KEY MAPPINGS                                   *operator-replace-key-mappings*

["x]<Plug>(operator-replace){motion}            *<Plug>(operator-replace)*
                        Replace text that {motion} moves over with register x.




==============================================================================
EXAMPLES                                        *operator-replace-examples*

(A) At first, you have to map arbitrary key sequences to
    |<Plug>(operator-replace)| like the following:
>
        map _  <Plug>(operator-replace)
<

(B) Suppose that you edit a buffer with the following content:
    (note that "^" indicates the cursor position)
>
        (herb oil pepper) salt water
        ^
<
    If you yank "sugar" into register x, now you can replace any text with the
    yanked text.  For example:

        To replace the 2nd word:
>
                w"x_iw
<
        To replace inside the parens:
>
                "x_ib
<
        To replace the cursor line:
>
                "x__
<




==============================================================================
BUGS                                            *operator-replace-bugs*

- Combinations of wises of {motion} and register content are not considered
  well, especially with blockwise ones.

- See also |operator-user-bugs|.




==============================================================================
CHANGELOG                                       *operator-replace-changelog*

0.0.1   2009-09-16T07:59:40+09:00           *operator-replace-changelog-0.0.1*
        - Fix edge case bugs.  Now replaacing at the end of line or the end of
          buffer work as you expect.

0.0.0   2009-09-06T10:13:20+09:00           *operator-replace-changelog-0.0.0*
        - Initial version.




==============================================================================
vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker: