3

I often find myself finding files in a shell, and then wanting to edit all of them in a single gvim instance.

But the following: find . -name foo -print0 | xargs -0 gvim opens a gvim instance for every file found (gvim 'find . -name foo' doesn't work aswell).

How can I open all of them in a single instance? (no splits or tabs needed)

EDIT: I narrowed it down to simply running the command gvim file1 file2 opens 2 instances. Can't find anything in gvim help on how to make it open one.

  • 1
    The command gvim file1 file2 will open one instance of gvim. What makes you think it opens two? – garyjohn Nov 29 '10 at 15:38
  • it was something wrong with my .bashrc that made it not work. thanks – Idan K Nov 29 '10 at 15:44
4

vim `find . -name foo`

  • that works with vim but not with gvim – Idan K Nov 29 '10 at 15:33
  • Try 'gvim -U NONE files'. This will not read initialization files, perhaps there is something that causes this behavior. – JooMing Nov 29 '10 at 15:38
  • 1
    ah! it wasn't something with my .vimrc but you got me thinking and it was something related to my .bashrc. thanks! – Idan K Nov 29 '10 at 15:43
  • @Gilles: I know that, and thanks for reminding :) I suggested this command to rule out the possibility that xargs executed gvim twice. – JooMing Nov 30 '10 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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