Tip #321: Centura swap with upper/lower line behavier
tip karma |
Rating 14/5, Viewed by 465
|
created: |
|
August 27, 2002 14:52 |
|
complexity: |
|
basic |
author: |
|
Simon "neoneye" Strandgaard |
|
as of Vim: |
|
6.0 |
I was once forced to use a windows development suite called "Centura".
The only good thing i remember was its swap current_line with upper/lower line.
function! MySwapUp()
let cur_col = virtcol(".")
normal ddkkp
execute "normal " . cur_col . "|"
endfunction
function! MySwapDown()
let cur_col = virtcol(".")
normal ddp
execute "normal " . cur_col . "|"
endfunction
" swap lines and preserve cursorx
" todo: in visual mode, perform swap with line before/after the selection
noremap <S-Up> :call MySwapUp()<CR>
noremap <S-Down> :call MySwapDown()<CR>
<<Borland pageup/down behavier |
text template with placeholders >>
Additional Notes
|