Thursday, June 21, 2012

Re: Can vim be made to start with selected files already open?

On 2012-06-21, Tim Gray wrote:
> On Jun 21, 2012 at 01:11 PM -0400, Eric Weir wrote:
> >A quick scan of results on these topics gives me a vague idea of
> >what they are. I'll have to study more carefully to get clear how
> >I would construct an alias to access the files I want to load.
> >I.e., whether the path needs to be explicit. Also to call it for
> >MacVim.

[Long discussion of aliases omitted.]

Rather than use a bash alias, since Eric said he seldom uses a
terminal, why not just put a Vim command in ~/.vimrc? For example,
instead of

alias vimf='vim -o file1 file2 file3 file4'

use

command All :args file1 file2 file3 file4 <bar> all

or to open all those files in individual tabs,

command All :args file1 file2 file3 file4 <bar> tab all

Then, whenever you want to open all those files, just execute

:All

Of course, for that to work as written, all those files will have to
be in the working directory. It would probably be better to use
their full path names. On the other hand, if you always open gvim
by clicking an icon on your desktop, your working directory may
already be set appropriately.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment