I'd like to have NERDTree shown everytime I start gvim empty, that is without passing any argument to it, starting simply to load files rather than to create a new one, such as just by issuing
gvim (and not
The list of filename arguments can be obtained by calling argv(), so you could put something like this in your ~/.vimrc:
if empty(argv()) NERDTree endif
Note that putting a command in your ~/.vimrc, whose contents are executed before any plugins are normally loaded, requires that the source for that command be sourced first. Alternatively, you could put this in your ~/.vimrc:
if empty(argv()) au VimEnter * NERDTree endif
That will delay the execution of the NERDTree command until after all the plugins have been loaded.