I tried to ask it in Reddit as well but did not able to find answer, so repeating here now, my apologies!
In neovim telescope (fuzzy finder) once you search for file ctrl+v and ctrl+x allows to open file in vertical or horizontal split respectively.
Is it possible to have something similar in here for find-files and projectile-find-files. I do come across find-file-other-window but it always performs vertical split only.
Hey @dhruvinsh, the way of doing this largely depends on your completion module / method. For the one I am familiar with, vertico and more specifically, embark, you can add your file specific keybindings in the embark-file-map. You can find more info in embarks README.
With ivy I imagine you can change the ivy-minibuffer-map to similar effect, though I am not sure if it’s limited to files or not, so you ought to be a bit more careful for when you call the binding. I imagine is not that different for helm or ido but I’m not familar with them.
Pressing RET invokes the “default action” of whatever command you’re using. For most file commands, that means opening the file in the current window.
However, all our completion frameworks (except for ido) support invoking an alternative action on the selected candidate(s):
For helm, press TAB. To add to it, you add them to the appropriate source, e.g. with helm-add-action-to-source, but I haven’t used Helm in years to recall the specifics. [1]
For the other user like me, how it works for me is, SPC p p to access project files then while in project if I want other files to be open in split windows SPC p f to do projectile-find-file search the file and then C-; to initiate embark and V or X to open in vertical or horizontal split.
What you experience can be controlled by evil-split-window-below and evil-vsplit-window-right. For seeing how these settings behave, you could try these two functions (mapped to v and V in this example):
You can see that v puts your cursor in the new window while V does not. Please keep in mind that the v mapping is already in use, only use it if you don’t mind overriding its default value.
Somehow I did not find any change in behavior. I was getting split windows but cursor wasn’t moving to the new one. But found other solution. Thank you for pointing me in the right direction.