matze / vim-move

Plugin to move lines and selections up and down
http://www.vim.org/scripts/script.php?script_id=4687
MIT License
1.21k stars 56 forks source link

[Feature Request] Moving blocks based on previous content #31

Open D1mon opened 5 years ago

D1mon commented 5 years ago

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
hugomg commented 4 years ago

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