As of 8.1.2233 Vim has v:argv
available to represent the arguments Vim
was invoked with as a list.
We can get an equivalent list on *NIX systems with the following, useful
if the version of Vim does not support v:args
.
split(system('ps -o command= -p' . getpid()))
We could use something like the following as a compatibility shim, though of course an extra condition for non *NIX systems is missing.
function! GetArgv() abort
return exists('v:argv') ?
\ v:argv :
\ split(system('ps -o command= -p' . getpid()))
endfunction