$ ls -alh[enter]
o[esc]to ensure you have a blank line at the end of the output.
qto finish recording the macro
$ ls -t | head -n 5[enter]
[esc]and then move the cursor to the line after the command - you can use the command
@eto execute the macro.
[ctrl+o]@ewhilst on the line after the command.
:reg eshould look something like:
$to select to the end of the line then press
hto move the cursor back one character - to avoid copying the newline character at the end. Then press
yto yank the line.
:reg eagain, it should output something like this:
e- to paste the content of register e into a blank line in your document and then make your edits, before visually selecting the edited line and then deleting back to register e using something like
"isn't the problem, then the only other thing I can think of is the potential line-ending problem. In which case, the workaround I've posted should fix that.
eto paste the current contents of register e into the command you're in the middle of typing. (And yes - that's pressing ctrl+r twice!)
yand ensure that there is a
[ctrl+r]character (^R character) and the
'and now, finally press
[enter]and that should store the modified contents to register e.