Monday, January 19, 2009

Cut/Copy and paste in vi

To cut and paste in vi:

Get to command mode (press esc) and type mx at the start of the place you would like to cut and go to the position where you want to stop cutting and type d'x.

Explanation: m
starts a buffer with name x and d'x will cut it.

To copy and paste in vi:

Type mx and y'x

Explanation: same as above except that y'x is meant for yanking (copying) buffer with name x.

No comments: