A good friend of mine called "cat file.txt" UUOC on the grounds I should have run "less file.txt". If you're writing a script, sure. If it's the first step in a pipeline that you're typing on the fly, does it really matter?
Sure, few seconds isn't a lot, to someone who opens terminal once a year.
Additionally, if you're using a nicer colorizing pager, like bat, it'll automatically send the output to your pager for you when it detects that the output wouldn't fit on screen.
For both of those reasons, I almost never use `less` directly on a file.
Obviously you don't have to use vim, any other editor or whatever can be used.
In zsh, there are equivalent expansions:
!!:1 previous command line, arg 1 (zero-indexed)
!!:$ previous command line, LAST arg
!!:1-$ previous command line, args 1-end (zero-indexed)
So, e.g.: cat /etc/passwd /etc/shadow /etc/group
vi !!:1-$
(becomes) vi /etc/passwd /etc/shadow /etc/groupIf I wanted to do the cat/vim switcheroo you described, I'd more likely do:
<UpArrow><Esc>vcwvi<Esc>:wq<Enter><Enter>
Which is a greater number of keypresses, but more flexible and requires less thought....as they say: Unix is user-friendly — it's just choosy about who its friends are.
:set t_te=
Useful because vi makes it more convenient to select the chunk of file I want to view after exiting. More convenient than cat/head/tail at least. Competitive with more. :)