Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

vim move line down

# To move a line up
ddkP # delete line -> move up a line -> paste above the current line

# to move a line down
ddP # delete line -> paste above the current line

# to move a line <number> times up
dd<number>kP # delete, move <number> lines up and paste above

# to move a line <number> times down
dd<number>jP # delete, move <number> lines down and paste above
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vim #move #line
ADD COMMENT
Topic
Name
9+7 =