sponsor Vim development Vim logo Vim Book Ad

vim-movelines : Vim plugin for moving lines in normal and visual mode.

 script karma  Rating 2/2, Downloaded by 169  Comments, bugs, improvements  Vim wiki

created by
Krzysztof Cieslak
 
script type
indent
 
description
Vim plugin for moving lines in normal and visual mode.

https://github.com/krcs/vim-movelines
 
install details
Copy movelines.vim into ~/.vim/plugin or $HOME/vimfiles/plugin directory.

For normal mode call MoveLineNormal(direction). For virtual mode call MoveLinesVisual(direcion).

direction - Up,Down,Left,Right, words or only first letter.

In the .vimrc file insert following lines to map keys, I am using Alt+[cursor key]:

nnoremap <silent> <A-j> :call MoveLineNormal(\"d\")<CR>
nnoremap <silent> <A-h> :call MoveLineNormal(\"l\")<CR>
nnoremap <silent> <A-l> :call MoveLineNormal(\"r\")<CR>

xnoremap <silent> <A-h> :call MoveLinesVisual(\"left\")<CR>
xnoremap <silent> <A-l> :call MoveLinesVisual(\"Right\")<CR>
xnoremap <silent> <A-j> :call MoveLinesVisual(\"down\")<CR>
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
MoveLines.vim 1.0 2021-06-06 7.0 Krzysztof Cieslak Initial upload
ip used for rating: 3.133.109.211

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github