Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy to clipboard 3 last lines from :messages

Tags:

vim

If I use :messages vim command I get to pager like mode with vim log, where I cannot select lines without mouse (in some programs like neovim-qt I cant even use right-click menu (like in gnome terminal) to copy text)

how to copy 3 last lines?

like image 818
srghma Avatar asked Jan 15 '17 16:01

srghma


People also ask

How do I copy all the lines in vi editor and paste in notepad?

Press y to copy, or d to cut the selection. Move the cursor to the location where you want to paste the contents. Press P to paste the contents before the cursor, or p to paste it after the cursor.


1 Answers

You can redirect the output of :message to the clipboard register (@+) or primary register (@*):

:redir @+
:3message
:redir END

See :help :redir, :help :message.

like image 73
romainl Avatar answered Oct 25 '22 06:10

romainl