Bridging the gap
After years of daily swims in the vast sea of Vim-plugins, ranging from 2-line snippets to full-blown superstar programs, I have observed how a very significant amount of these plugins aim to bring Vim closer to the Shell by filling the gap with plugins that basically wrap Shell-functionality into neat little Vim commands.
While many of these plugins surely justify the time spent installing, configuring and learning them, I cannot help feeling that the approach is "odd". It kind of feels like siblings; they may need, support and love each other, yet marrying them would be weird. That is how I feel about Vim and the Shell.
So what are our options?
Out of the box, your best bet for interacting with the shell through Vim would be something along the lines of:
1) Run a 'ls -al' in a separate window, Vim restored when the command finishes and user presses the ENTER key.
2) Starts a shell inside Vim. Leaving the shell by typing 'exit' returns the user to Vim.
3) C-z (Control+z) puts Vim in the background, giving the user back to the shell while keeping the Vim-session intact. At this point, the user may use the shell indefinitely and can at any time restore Vim by typing 'fg'.
C-z $ grep -ir "penguins" . $ fg
Extra: Output from system commands can also be piped into Vim using the :r ex-command.
:r! ls -al
Ain't that all we need?
Perhaps. While these are all great options and have slightly different areas of usage, none of the above options are asynchronous. Additionally, the only option that feels native, as if I am not working inside an "artificial environment", is 3.
Wouldn't it be great to be able to do a deep find/grep/ack search, or perhaps start a daemon in a pane while being able to continue writing in another? Vim doesn't allow this, as it as of today does not support asynchronous invocations. Since Vim alone is unable to do more than one thing at the same time (can we now conclude Vim is a male?), Vim has to hand out tasks to someone else, say a wrapping program like tmux (a terminal-multiplexer alternative to screen).
But at the end of the day, Vim alone cannot (to my knowledge) perform asynchronous tasks.
Taking into consideration the great community of Vim and the empirical fact that Vim-users will, no matter how ugly the hack, make things work in the end, I would expect that if something that was considered a complete necessity was missing, it would get out there somehow.
Except.. If it's intentional
Like Emacs is jokingly referred to as an Operating System due to its rich multitude of ways to interact with your system, I feel that Vim is in the complete opposite end of the spectrum.
Vim doesn't feel like it's meant to be used to sending emails. Vim doesn't feel like it's meant to be used to tail logs, kill processes, modify access rights and restart daemons. However, Vim does feel like the worlds deadliest army-knife in terms of chopping, rearranging and creating new code, and I am completely, utterly satisfied with that.
Should Vim, taking it's historical roots and technical design into consideration,
be used for more than editing?