Skip to content

Commit

Permalink
Support count prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matze committed Aug 9, 2013
1 parent ce0a2b4 commit 8f58d3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/move.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ To enable custom key maps you must disable the automatic key maps with >
let g:move_map_keys = 0
All mappings can be prefixed with a {count} and will move {count} steps
instead of one.

-------------------------------------------------------------------------------
2.1 <Plug>MoveBlockDown

Expand Down
8 changes: 8 additions & 0 deletions plugin/move.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ endfunction
function! s:MoveBlockDown() range
let next_line = a:lastline + 1

if v:count > 0
let next_line = next_line + v:count - 1
endif

if next_line > line('$')
call s:ResetCursor()
return
Expand All @@ -36,6 +40,10 @@ endfunction
function! s:MoveBlockUp() range
let prev_line = a:firstline - 2

if v:count > 0
let prev_line = prev_line - v:count + 1
endif

if prev_line < 0
call s:ResetCursor()
return
Expand Down

0 comments on commit 8f58d3b

Please sign in to comment.