Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands: QuickOpen - open in vertical split / open in horizontal split #564

Closed
bryphe opened this issue Aug 2, 2019 · 4 comments · Fixed by #3733
Closed

Commands: QuickOpen - open in vertical split / open in horizontal split #564

bryphe opened this issue Aug 2, 2019 · 4 comments · Fixed by #3733
Labels
A-workspace Area: Overall UX, editor layout, tabs/groups/splits etc. enhancement New feature or request

Comments

@bryphe
Copy link
Member

bryphe commented Aug 2, 2019

For the QuickOpen, it is often convenient to be able to open directly in a split.

We should have shortcut keys out-of-the-box for this, as well as have them be bindable commands.

Proposal:

  • quickOpen.verticalSplit - opens the currently selected file in a vertical split (Default: <c-v>)
  • quickOpen.horizontalSplit - opens the currently selected file in a horizontal split (Default: <c-s>)

These commands would only be enabled when the quickopen menu is up

@mhanberg
Copy link
Contributor

mhanberg commented Aug 2, 2019

I would suggest making the default horizontal split be <c-x>.

This is the default command that is used by fzf.vim and ctrlp.vim

However, the command-t vim plugin uses <c-s>, so i'll admit that it is subjective.

VSCode currently uses <c-enter> to do a vertical split (I don't know if it's possible to do a horizontal split).

@hovsater
Copy link
Contributor

hovsater commented Aug 3, 2019

As an avid Vim user myself, I find <c-s> and <c-v> familiar since <c-w s> and <c-w v> split and vertically split respectively in vim. I'll have to admit that <c-x> and <c-v> is pretty much muscle memory at this point as well since I'm using FZF on a daily basis.

If I had to vote, I'd go with <c-s and <c-v>.

@hovsater
Copy link
Contributor

hovsater commented Aug 7, 2019

I'm up for giving this a shot. 🙂

@hovsater
Copy link
Contributor

hovsater commented Aug 8, 2019

@bryphe looking through the code I believe we don't distinguish between what kind of menu is being open. It looks like we're using MenuOpen and depending on what command triggered it, populate the contents accordingly. Is that right?

If that's the case, I thought it might be a good idea talking a bit about how we move forward. Since we're about to add bindable commands for opening a given file in a split, I can see a use case for adding the ability to determine what type of menu is currently open.

We could either extend MenuOpen(menuCreator) with another constructor argument such as MenuOpen(menuType, menuCreator) or separate them altogether.

What are your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-workspace Area: Overall UX, editor layout, tabs/groups/splits etc. enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants