1

I like vim, but I don't like its buffers. Is there any way to launch a separate gvim whenever you would normally open a file in a new buffer? I could probably alias :edit to some other launch command, but is that the right approach?

Jeff
  • 343

3 Answers3

2

For me, window splits and the ability to quickly switch, yank and paste between them are essential to effectively working with Vim. Of course, you can develop your own idiosyncratic workflow, but I'd recommend against it. Instead, make every effort to follow what a vast army of Vi(m) users have found very useful. Despite the sometimes steep learning curve, it's important to know the difference between files, buffers, windows, and tab pages.

As a sort of middle ground, you can try experimenting with opening new files in tab pages (i.e. use :tabedit instead of :edit) as an alternative to launching a full separate Vim instance. The feeling is like in web browsers, and you keep the benefit of shared registers and marks.

Ingo Karkat
  • 23,523
0

GVim does not support multiple "toplevel" windows (see Using Vim/Gvim with multiple GUI windows). But you could hack around it by creating a user command that launches a new gVim process. Something like this:

:command -nargs=* -complete=file New :call system('gvim ' . shellescape(<f-args>))

This command may fail in interesting ways with "creative" filenames. I tried to make it robust without making it complex, but I have not extensively tested it.

There are a number of drawbacks to insisting on using Vim this way. You may not like Vim's buffer handling, but it can be quite useful if you can learn to use it.

Heptite
  • 20,411
0

The "buffer way" has many benefits: all the buffers you work with share registers, for example, or one global mapping or option defined in one window is available for all the others, or you get copy/paste and multiple registers without a window manager, or you can reference parts of other buffers in Ex commands…

Anyway, you could probably do something like :!gvim filename. But, in absence of a reasonable list of benefits of this method and drawbacks of the "buffer way") there's really no point in doing that.

romainl
  • 23,415