sponsor Vim development Vim logo Vim Book Ad

mlessnau_block_shift : Line-wise up/down shift of selected blocks

 script karma  Rating 1/1, Downloaded by 1087  Comments, bugs, improvements  Vim wiki

created by
Michael Leßnau
 
script type
utility
 
description
The plugin implements 2 functions: BlockShiftUp() and BlockShiftDown(). When selecting blocks of text in visual mode, these functions will shift the block one up, or down. The textmanip plugin offers equal functionality but did not behave the way I would've expect it.
 
install details
Copy the file into you plugins directory (i.e. ~/.vim/plugins). Now you need to define the keyboard mappings in your .vimrc file:

vmap <C-k> :call BlockShiftUp()<CR>
vmap <C-j> :call BlockShiftDown()<CR>

So, when you're in visual mode and selected a block of text, you now can shift it up/down by pressing [Ctrl]+[k] and [Ctrl]+[j].
 

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
mlessnau_block_shift.vim 0.0.1 2013-10-27 7.3 Michael Leßnau 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