24

GitHub - matze/vim-move: Plugin to move lines and selections up and down

 6 years ago
source link: https://github.com/matze/vim-move
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.md

move

It's annoying to delete and paste parts of a text just to move it up and down a bit. There is the :m[ove] command but it is quite awkward to use by todays standards. vim-move is a Vim plugin that moves lines and selections in a more visual manner. Out of the box, the following keys are mapped in visual and normal mode:

<A-k>   Move current line/selection up
<A-j>   Move current line/selection down

The mappings can be prefixed with a count, e.g. 5<A-k> will move the selection up by 5 lines.

See this short demo for a first impression:

vim-move demo

Installation

vim-move is compatible with all major plugin managers. To install it using Vundle, add

Bundle 'matze/vim-move'

to your .vimrc.

Customization

Use g:move_key_modifier to set a custom modifier for key bindings. For example,

let g:move_key_modifier = 'C'

which will create the following key bindings:

<C-k>   Move current line/selections up
<C-j>   Move current line/selections down

License

This plugin is licensed under MIT license.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK