The documentation of fnameescape contains an example command that
moves the cursor to the most recently modified file, but that file could
also be a directory.
So to exactly address your request, put the fragment below in
~/.config/vifm/vifmrc, restart Vifm and now you can use
,f to jump to the most recent non-directory file*.
"Cursor to most recently modified file
noremap ,r :exe 'goto' fnameescape(system('ls -At | head -n 1'))<CR>
"Cursor to least recently modified file
noremap ,o :exe 'goto' fnameescape(system('ls -Art | head -n 1'))<CR>
"Cursor to most recently modified non-directory file
noremap ,f :exe 'goto' fnameescape(system('ls -Atp | grep -vm1 /'))<CR>
"Cursor to least recently modified non-directory file
noremap ,l :exe 'goto' fnameescape(system('ls -Atrp | grep -vm1 /'))<CR>
As you can see, I also provide additional related mappings for your convenience.
*Assuming the file-name does not contain a newline character.
How does it work?
goto is the Vifm function that moves the cursor to a given file.
The desired file is the first non-directory file listed by ls -Atp, i.e., the
first line that does not contain a slash. grep -v / filters out lines that
contain a slash, and the -m1 option tells it to only return the first match.
Although -m is available in BSD and GNU/Linux systems, it is not required by POSIX,
so if your Grep lacks it, just use
grep -v / | head -n 1 or sed '\:/:d;q' instead.