Using ex
I open 3 files
ex file1 file2 file3
I know
- the command
:n
goes to file 2 and file3 - the command
:rew
go to file1 from file3 or file2
But what command can I use to go to previous file?
I think :e previousfile
will work, but does something
quicker like :n
for previous exist?
Best Answer
From the POSIX specifications for
ex
:So, in most implementations,
:prev
will do what you want. (That is, most implementations ofex
that I've encountered; obviously you shouldn't rely on this for portable scripting.)Note also that this is not the same as
:p
, which actually means top
rint the current line.prev
is the shortest abbreviation allowed. (pre
means "preserve".)