I often find myself operating in the vim terminal needing to edit a few files. In this case I might type vim *.h. This opens a new vim instance nested inside my vim terminal. Is there a way to make a command that instead triggers the parent vim instance to load the files in buffers?

  • I suppose you mean :args *.h – Matt Oct 9 '19 at 13:43
  • 1
    If I understand your question properly, it is a duplicate of this one: Start vim with vim --servername SERVER and from within the terminal buffer use vim --servername SERVER --remote *.h. However I think your workflow could be improved: you don't need to open a terminal to open new files, instead you could use builtin commands like :h :args or :h :argadd or even a fuzzy finder like fzf – statox Oct 9 '19 at 21:03
  • 1
    If you're using neovim, github.com/mhinz/neovim-remote does what you want. Other options are covered in question linked by @statox. – Thunderbeef Oct 9 '19 at 22:17
  • @statox - I think the example I chose is too simplified. I often want to use complex pipes of greps to make a file list. For example vim $( ... something ... ). Which I can do easily, but I would like it not create a session nested inside the terminal, and instead pop up a series of buffers. – Joel Holdsworth Oct 10 '19 at 9:46

Your Answer

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

Browse other questions tagged or ask your own question.