sponsor Vim development Vim logo Vim Book Ad

textmanip.vim : Maniplate(duplicate, move) selected text easily

 script karma  Rating 25/19, Downloaded by 3504  Comments, bugs, improvements  Vim wiki

created by
t9 md
 
script type
utility
 
description
What is this?
=============================================================
* move visually selected text easily ( linewise / blockwise )
* duplicate text easily ( linewise / blockwise )
* count support
* keep original cursor position (include 'o'ther pos in visualmode!) while moving / duplicating.
* undo with one 'u' by undojoining.

See [ScreenCast](http://www.youtube.com/watch?v=iJh7Z0Rp-rI) for v0.4.
Github https://github.com/t9md/vim-textmanip

# Configuration example

### GUI macvim ( which I use now )

    xmap <D-d> <Plug>(textmanip-duplicate-down)
    nmap <D-d> <Plug>(textmanip-duplicate-down)
    xmap <D-D> <Plug>(textmanip-duplicate-up)
    nmap <D-D> <Plug>(textmanip-duplicate-up)

    xmap <C-j> <Plug>(textmanip-move-down)
    xmap <C-k> <Plug>(textmanip-move-up)
    xmap <C-h> <Plug>(textmanip-move-left)
    xmap <C-l> <Plug>(textmanip-move-right)

### gVim

    xmap <M-d> <Plug>(textmanip-duplicate-down)
    nmap <M-d> <Plug>(textmanip-duplicate-down)
    xmap <M-D> <Plug>(textmanip-duplicate-up)
    nmap <M-D> <Plug>(textmanip-duplicate-up)

    xmap <C-j> <Plug>(textmanip-move-down)
    xmap <C-k> <Plug>(textmanip-move-up)
    xmap <C-h> <Plug>(textmanip-move-left)
    xmap <C-l> <Plug>(textmanip-move-right)

### vim on terminal

    xmap <Space>d <Plug>(textmanip-duplicate-down)
    nmap <Space>d <Plug>(textmanip-duplicate-down)
    xmap <Space>D <Plug>(textmanip-duplicate-up)
    nmap <Space>D <Plug>(textmanip-duplicate-up)

    xmap <C-j> <Plug>(textmanip-move-down)
    xmap <C-k> <Plug>(textmanip-move-up)
    xmap <C-h> <Plug>(textmanip-move-left)
    xmap <C-l> <Plug>(textmanip-move-right)
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-textmanip-1.8.zip 1.8 2013-11-02 7.0 t9 md Support  replace-mode, which overwrite area and write back when selection pass that area.
Code clean up/ bug fix.
vim-textmanip-1.3.zip 1.3 2013-10-29 7.0 t9 md bug fix, error when g:textmanip_enable_mappings is not defined.
vim-textmanip-1.2.zip 1.2 2013-10-27 7.0 t9 md [bugfix] count did not work for some direction.
vim-textmanip-1.1.zip 1.1 2013-10-26 7.0 t9 md now support blockwise movement.
complete code rewritten and many improvement, especially line up/down move now much faster than older version.
vim-textmanip-0.7.zip 0.7 2011-08-15 7.0 t9 md 2011-08-16: v0.7
        - [bugfix] extend_eol not worked in some situation.
vim-textmanip-0.6.zip 0.6 2011-08-15 7.0 t9 md - [bugfix] better handling for redraw problem
vim-textmanip-0.5.zip 0.5 2011-08-14 7.0 t9 md - [bugfix] handle left and up movement limit.
- [bugfix] more strict check to determine continuous execution.
- [bugfix] remove unnecessarily `undojoin` twice, and remove catch clause(E790)
vim-textmanip-0.4.zip 0.4 2011-08-14 7.0 t9 md 2011-08-14: v0.4
        - support count for duplicate and move
        - bug fix for `undojoin`
        - refactoring,, support duplicate text to upper direction.
        - change keymap for consistency, sorry.
        - autoloadize!
textmanip-0.3.zip 0.3 2011-07-16 7.0 t9 md fix documentation bugs.code re-indent(so no change in code)
textmanip-0.2.zip 0.2 2011-06-15 7.0 t9 md 0.2 2011-06-13
- Fix document typo
textmanip.zip 0.1 2011-03-09 7.0 t9 md Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github