—headless
Start without UI, and do not wait for nvim_ui_attach. The builtin TUI is not used, so stdio works as an arbitrary communication channel. channel-stdio Also useful for scripting (tests) to see messages that would not be printed by -es. To detect if a UI is available, check if nvim_list_uis() is empty during or after VimEnter. To read stdin as text, ”-” must be given explicitly: —headless cannot assume that stdin is just text.
echo foo | nvim --headless +"%print" +"q!" -