Is there a simple command that will move lines from one window to another. Currently I go to one window, yank the lines, and then paste in the other window.
I would like to know if I can do it without switching windows.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would do this sort of thing with a macro. So to record a macro for a, qa. Then yy to yank the line, :bnext to switch buffers, p to paste the line, then bnext again to switch back to the original buffer (on the line you started on). Then hit q to stop recording.
So to copy, switch windows, paste then switch back, you just need to use @a. Or map it to a function key (map @a).
N.B. Just noticed in the comments you had multiple buffers, so obviously you would need to record your macro accordingly.