diff --git a/README.md b/README.md index 2c03e79..032fc96 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ - [Saner command-line history](#saner-command-line-history) - [Saner CTRL-L](#saner-ctrl-l) - [Disable audible and visual bells](#disable-audible-and-visual-bells) -- [Quickly move current line](#quickly-move-current-line) +- [Quickly move current line, multiples lines](#quickly-move-current-line-multiple-lines) - [Quickly add empty lines](#quickly-add-empty-lines) - [Quickly edit your macros](#quickly-edit-your-macros) - [Quickly jump to header or source file](#quickly-jump-to-header-or-source-file) @@ -1981,7 +1981,7 @@ set t_vb= See [Vim Wiki: Disable beeping](http://vim.wikia.com/wiki/Disable_beeping). -## Quickly move current line +## Quickly move current line, multiple lines Sometimes I need a quick way to move the current line above or below: @@ -1992,6 +1992,25 @@ nnoremap ]e :execute 'move +'. v:count1 These mappings also take a count, so `2]e` moves the current line 2 lines below. +You can also try out [Vim Move](https://github.com/matze/vim-move) which provides similar functionalities that allow move curren line as well as multiples lines with custom mappings: + +```vim +" Disable Vim Move default mappings +let g:move_map_keys = 0 + +" Move current line up with Shift-K +nmap MoveLineUp + +" Move current line down with Shift-J +nmap MoveLineDown + +" Move a block of code up with Shift K +vmap MoveBlockUp + +" Move a block of code down with Shift J +vmap MoveBlockDown +``` + ## Quickly add empty lines ```vim