Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matze/vim-move
Plugin to move lines and selections up and down
https://github.com/matze/vim-move
vim vim-plugin
Last synced: 12 days ago
JSON representation
Plugin to move lines and selections up and down
- Host: GitHub
- URL: https://github.com/matze/vim-move
- Owner: matze
- License: mit
- Created: 2013-08-09T20:57:40.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-10-08T14:03:13.000Z (about 1 year ago)
- Last Synced: 2024-10-15T09:05:54.272Z (26 days ago)
- Topics: vim, vim-plugin
- Language: Vim Script
- Homepage: http://www.vim.org/scripts/script.php?script_id=4687
- Size: 84 KB
- Stars: 1,201
- Watchers: 15
- Forks: 56
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# move
It's annoying to delete and paste parts of a text just to move it up/down or
left/right 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:Move current line/selection up
Move current line/selection down
Move current character/selection left
Move current character/selection rightThe mappings can be prefixed with a count, e.g. `5` will move the selection
up by 5 lines.Features:
* vertical motions
* horizontal motions
* automatic indentation
* undo multiple moves with single `:undo`See this short demo for a first impression:
![vim-vertical-move demo](http://i.imgur.com/RMv8KsJ.gif)
![vim-horizontal-move_demo](https://i.imgur.com/zKWEecp.gif)
## Installation
vim-move is compatible with all major plugin managers. To install it using
Vundle, add```vim
Bundle 'matze/vim-move'
```to your `.vimrc`.
To install it using vim-plug, add
```vim
Plug 'matze/vim-move'
```to your `.vimrc`.
## Customization
Use `g:move_key_modifier` to set a custom modifier for key bindings in normal mode. For
example,```vim
let g:move_key_modifier = 'C'
```which will create the following key bindings:
Move current line/selections up
Move current line/selections downUse `g:move_key_modifier_visualmode` to set a custom modifier for key bindings in visual mode. For
example,```vim
let g:move_key_modifier_visualmode = 'S'
```which will create the following key bindings:
Move currently selected block up
Move currently selected block downAnd so on...
*NOTE*
Both `g:move_key_modifier` and `g:move_key_modifier_visualmode` default to 'A'
for backwards compatibility with previous versions of vim-move.If the default mappings do not work, see the `move_normal_option` option in the
help doc.## License
This plugin is licensed under MIT license.