matze / vim-move

Plugin to move lines and selections up and down

Home Page:http://www.vim.org/scripts/script.php?script_id=4687

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Moving blocks based on previous content

D1mon opened this issue · comments

commented

select all 2 and move up:

1 1 1 1
1 1 1 1
1 1 1 1
        2 2 2 2
        2 2 2 2
        2 2 2 2

it should end up like this:

1 1 1 1 2 2 2 2
1 1 1 1 2 2 2 2
1 1 1 1 2 2 2 2

What should this do if there are non-whitespace characters in the region that we are moving into?
For example, if we start with the following text and move the block ot 2's up by 2 lines what should be the result?

1 1 1 1 a a a a
1 1 1 1 b b b b
1 1 1 1 c c c c
        2 2 2 2
        2 2 2 2
        2 2 2 2

Should it be moved over the old text, leaving whitespace behind?

1 1 1 1 a a a a
1 1 1 1 2 2 2 2
1 1 1 1 2 2 2 2
        2 2 2 2    

Or should the old text be moved down, similarly to what is currently done when a block is moved horizontally?

1 1 1 1 a a a a
1 1 1 1 2 2 2 2
1 1 1 1 2 2 2 2
        2 2 2 2
        b b b b
        c c c c