I'm doing some debugging, which involves checking logfiles name "blah N.log" where N is an integer. Periodically, a new log file gets added, and I'd like to just skip to the next log file, rather than explicitly do :e blah\ N.log
. I can't just do % vim *.log
and then :n
, b/c not all the log files exist yet.
I've got an expression that yields the next logfile name:
:echo substitute(expand('%'), ' \zs\d\+', \=submatch(0) + 1', '')
But I can't figure out how to pass the result of that expression to an :e
command. Any tips?