Vim startup options

234 views
Skip to first unread message

Jay Heyl

unread,
Feb 29, 2012, 8:34:33 PM2/29/12
to vim...@googlegroups.com
I know the answer to this question is out there, but nothing I search for turns up what I'm looking for.

Is there a way from within Vim to determine what command line options were specified when that particular instance of Vim was started? Not compile options or .vim_rc settings, but strictly items specified on the startup command line. If Vim was started with '-r' and '+1234', is there a way to determine that from within Vim?

I'm having a problem where the first instance of Vim is running like normal, but when I launch additional instances those instances grab seriously huge amounts of memory and run like total dogs. This started after configuring a third party program to use Vim as its default editor and I have a suspicion this program changed something at the system level about the way Vim starts based on file type. I'd like to be able to see if the startup options are involved in some way.

  -- Jay

Marc Weber

unread,
Feb 29, 2012, 8:43:21 PM2/29/12
to vim_use

Talking about :args command?

Taylor Hedberg

unread,
Feb 29, 2012, 9:02:34 PM2/29/12
to vim...@googlegroups.com
Jay Heyl, Wed 2012-02-29 @ 17:34:33-0800:

> Is there a way from within Vim to determine what command line options
> were specified when that particular instance of Vim was started? Not
> compile options or .vim_rc settings, but strictly items specified on
> the startup command line. If Vim was started with '-r' and '+1234', is
> there a way to determine that from within Vim?

If you're running Linux, this will show you the full command line used
to start Vim, from within Vim:

:exe '!tr "\0" " " </proc/' . getpid() . '/cmdline'

signature.asc

Jay Heyl

unread,
Feb 29, 2012, 9:30:18 PM2/29/12
to vim...@googlegroups.com
On Wed, Feb 29, 2012 at 17:43, Marc Weber <marco-...@gmx.de> wrote:

Talking about :args command?

I think that was what I was looking for. On the good-new/bad-news front, the bad news is :args did not help in finding the problem. The good news is the problem went away when I closed down all current instances of Vim.

I've never had it do this before. Each successive instance seemed to want to allocate a multiple of the memory allocated by the previous instance. It finally threw an error trying to allocate about ten times more than the 8GB I have in the machine. 

Now each instance is allocating a small number of MB, just like it always has. Very strange. BTW, this is with Win7-64.

  -- Jay

Marc Weber

unread,
Mar 1, 2012, 8:46:37 AM3/1/12
to vim_use
WHat can influence Vim's behaviour?

a) env vars

b) command line arguments

c) environment ($VIMRUNTIME ~/.vim etc)

great: You can reproduce the problem easily. Thu you can debug it.
Now check echo $VIMRUNTIME and compare :!export > env-vars.txt
for both instances whether both differ.

And retry with empty/clean .vimrc and .vim (add a "finish" at the top)

Win7? Then you may have to find smething else than export
from: http://ss64.com/nt/set.html
The SET command invoked with a string (and no equal sign) will display a
wildcard list of all matching variables


is there any way to inspect all global vars in Vim? Their size would be
of interest (to out whether VimL is causing this).

Marc Weber

Reply all
Reply to author
Forward
0 new messages