2 ms·
For that you can just make the scripts 'gvim file' If on MacOS and you are using the apple native build, 'open -a gVim file' opens each file in the same editor
by mzs 2y ago
For that you can just make the scripts 'gvim file'
If on MacOS and you are using the apple native build, 'open -a gVim file' opens each file in the same editor.
If you want to do that on X11 (even macos X11.app) or MS Windows:
https://vimhelp.org/remote.txt.html#remote.txt https://vimhelp.org/remote.txt.html#remote.txt
Basically (or gvim, yu might want --remote-silent too):
vim --servername foo --remote-silent filename [ filename ... ]
The end of that doc explain you can use either Windows messages or OLE.
But the same doc explains how you can completely script vim from the command line:
Tell the remote server "foo" to write all files and exit:
vim --servername foo --remote-send '<C-\><C-N>:wqa<CR>'
^\^N is what you press on a keyboard to enter normal mode from every mode except ex mode without a beep.
:wqa means do the command Write All and Quit.
so with --remote-send you can send any sequence of key-strokes to act on buffers.
You probably want to read from https://vimhelp.org/intro.txt.html#notation https://vimhelp.org/intro.txt.html#notation to learn the fundamentals.
I'd avoid neovim initially until you learn enough to decided if you want it - pros and cons both ways.
- ericb 2y agoGreat response, thank-you! I've bounced into vim before. The modal nature threw me a bit--finding :wq written to my code wasn't awesome. :-) I might give it another shot.