I often use the :term
command in my projects to create new directories or perform other work.
However, if I have multiple windows open, then executing :term
from one of them will also close that window, when I exit the shell.
How can I execute :term
from the current window and return back to current buffer on exit?
:term
opens new window by default.:new +term
:!mkdir ...
or:silent !mkdir ...
or:call system('mkdir '.shellescape(...))
, etc. Use of:term
is usually only needed when you want a full screen app, a REPL, or when you want to run a background process (long compilation) without blocking the editor. But for simple tasks and short commands there are usually better approaches than:term
.:call system('mkdir '.shellescape(...))
? Isn't!mkdir ...
almost always the faster/better alternative?