While in vim I can write a range of lines from the file I'm viewing to another file. For example,
:1,10 w outfile.txt
will write lines 1 through 10 to outfile.txt.
Can I do the same while I'm viewing a file using less?
10Gmm1G|mcat > outfile.txt
(typed within less) seems to work as long as the input doesn't fit in one screen (in which case all the input ends up in outfile.txt for some reason).
cat > outfile.txt
You could use view which is the same as vi -r
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
10 months ago