I would like to open new tabs for each file matching an expression, each file in a new tab and as read only. I do not want to replace my current buffer, just append the new tabs.
This comes very close, but unfortunately it replaces any existing tabs:
command OpenLogs args X:\Path\ToLogs\*Log.txt | tab all | tabdo set readonly
Any ideas?
for f in glob(..) | execute ... | setlocal readonly | endfor
... I don't see the problems with creating a function, though, as it's more readable.