Skip to content

Commit

Permalink
Re-indent after movement
Browse files Browse the repository at this point in the history
  • Loading branch information
matze committed Aug 10, 2013
1 parent 0334675 commit 52bd033
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/move.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ if !exists('g:move_map_keys')
endif

function! s:ResetCursor()
normal! gv
normal! =
normal! gv
normal! ^
endfunction
Expand Down Expand Up @@ -62,10 +64,12 @@ function! s:MoveLineUp() range

if (line('.') - distance) < 0
execute 'm 0'
normal! ==
return
endif

execute 'm-' . distance
normal! ==
endfunction

function! s:MoveLineDown() range
Expand All @@ -79,10 +83,12 @@ function! s:MoveLineDown() range

if (line('.') + distance) > line('$')
execute 'm $'
normal! ==
return
endif

execute 'm+' . distance
normal! ==
endfunction

vnoremap <silent> <Plug>MoveBlockDown :call <SID>MoveBlockDown()<CR>
Expand Down

0 comments on commit 52bd033

Please sign in to comment.