For your particular case, you can use :vertical
sfind
, in which case you can Tab-complete the filename, same as you can do with :find
.
Short version is:
:vert sf lo<TAB>
Which will complete to:
:vert sf long_name_module.py
And will open your file in a vertical split as you requested.
More generally, Vim doesn't really have a concept similar to "pipes" in the shell to compose arbitrary commands, so there isn't really a general way to accomplish what you described with general commands.
The closest concept to this in Vim is that of commands that execute other commands but modify their behavior as they run.
Some examples of such modifier commands are:
:vertical
, which we just used in order to modify the way :sfind
works and split vertically rather than horizontally.
:leftabove
and :rightbelow
, which also change how splits will work, more specifically where the next splits will open.
:noautocmd
, to disable execution of auto-commands for a particular command execution.
:silent
, which can silent the output of commands it executes.
:sandbox
, to run a potentially untrusted command in a sandbox and contain its effects.
You can use many of these together. For example, :silent noautocmd vertical rightbelow call MyFunc()
will execute the MyFunc()
function, in silence, and if it splits to open a new file, it will be done vertically with a new split on the right, and no auto-commands will be executed for it. So, in a way, that's similar to how you'd chain multiple commands using pipes in a shell, right?
Note that for some particular cases, you end up with dedicated commands. For instance, there's not really a command modifier to open the next file in a new split, so you end up with :sfind
(similar to :find
), :new
(similar to :enew
), etc.
:e %:h
(show netrw in current file's directory) in to a vertical split. And I see I can do this with:vertical edit %:h
. I think given that my examples all send the output to a vsplit then you have given the answer