Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to set up vim so that it opens automatically in tab and not in buffers. I know that I could use alias gvim='gvim -p' or some such shell mapping but I am wondering if there is a way to do that from vim itself.

So, what I want is for

gvim ook eek monkey

to be equivalent in behaviour to

gvim -p ook eek monkey

aka a tab is opened for each file/buffer.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

See :tabnew and :tabedit in :help tabpage. (I'm not sure if you can (or want to) re-map :edit)

(Edit There is a related and helpful SO discussion)

(Edit to match your refined question) I doubt it will be less hassle than alias gvim=gvim -p, but using autocmd (and some Vimscript, everything in your .vimrc) this might be possible. (But I'm not knowledgeable enough to go into detail with this.)

share|improve this answer
    
Sorry, could not see how to set gvim behaviour to open multiple tabs if there is more than one filename on the command line. Edited question to make it more clear. –  Sardathrion Dec 15 '11 at 14:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.