1

vim -p opens, by default, in tabs viewport. Also having following autocommand

au VimEnter * if !&diff | tab all | tabfirst | endif

in vimrc accomplices the same thing as answered here. I am just wondering which is better approach in terms of performance

dlmeetei
  • 9,905
  • 3
  • 31
  • 38

1 Answers1

2

From a performance perspective, it shouldn't matter. The startup code (for -p) first creates all necessary tab pages, then fills them with the arguments. The :tab is a modifier to the :all command, which iterates over all arguments and opens a new tab page for each. As this all happens in native (compiled C) code, both should scale about the same with the number of arguments.

Why?

Many other applications use the one tab per document paradigm. While you can do that in Vim, too, you're missing out on window splits, which are very useful. Think of diff mode, the built-in :help, the preview window, command-line window, quickfix and location lists. All are opened in a split window, so you have to learn basic window navigation, anyway. @PeterRincker has already posted a link to a related question whose answers go into more detail (should you need more convincing arguments...)

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324