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

Move a single editor from one pane to another with vim ctrl-w #20205

Open
1 task done
tbenthompson opened this issue Nov 4, 2024 · 3 comments · May be fixed by #21760
Open
1 task done

Move a single editor from one pane to another with vim ctrl-w #20205

tbenthompson opened this issue Nov 4, 2024 · 3 comments · May be fixed by #21760
Labels
enhancement [core label] vim

Comments

@tbenthompson
Copy link

tbenthompson commented Nov 4, 2024

Check for existing issues

  • Completed

Describe the feature

In #5574 ctrl-w hjkl were set up to move between panes and ctrl-w HJKL to move a whole pane in a direction. I'm hoping for a variant of these commands that lets me move a single editor from one pane to another pane.

Unless I missed it, I don't think there's a command for this at the moment. I think having that command without any default keymapping would be wonderful.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@tbenthompson tbenthompson added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Nov 4, 2024
@notpeter notpeter added vim and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 5, 2024
@Igonato
Copy link

Igonato commented Nov 19, 2024

Not just vim. To support Sublime Text keybindings ctrl-shift-*number* would require a similar command, but for an nth pane.

I don't see any PRs open for anything similar, I'd like to take a swing at it.

So analogous to ActivatePane and ActivatePaneInDirection, would MoveToPane and MoveToPaneInDirection work? Or a bit more verbose MoveItemToPane and MoveItemToPaneInDirection?

@ConradIrwin
Copy link
Member

@Igonato please do! If. you want help feel free to book time here: https://calendly.com/conradirwin/pairing

Igonato added a commit to Igonato/zed that referenced this issue Dec 9, 2024
Closes zed-industries#20205

An action to move the active editor to a pane in a specified direction
Igonato added a commit to Igonato/zed that referenced this issue Dec 9, 2024
Closes zed-industries#20205

An action to move the active editor to a pane in a specified direction
@Igonato Igonato linked a pull request Dec 9, 2024 that will close this issue
@Igonato
Copy link

Igonato commented Dec 9, 2024

Ready for feedback #21760

Question: should we close the pane if the last item has been moved from it?

  • Sublime doesn't, but Sublime's empty pane is just an editor w/o the tab.
  • When the last item is moved with a mouse, Zed closes the pane, Sublime doesn't.
  • So closing the pane w/o items is more consistent with the rest of the Zed's behavior

Example bindings:

            "alt-shift-h": ["workspace::MoveItemToPaneInDirection", "Left"],
            "alt-shift-l": ["workspace::MoveItemToPaneInDirection", "Right"],
            "alt-shift-k": ["workspace::MoveItemToPaneInDirection", "Up"],
            "alt-shift-j": ["workspace::MoveItemToPaneInDirection", "Down"],

            "ctrl-shift-1": ["workspace::MoveItemToPane", 0],
            "ctrl-shift-2": ["workspace::MoveItemToPane", 1],
            "ctrl-shift-3": ["workspace::MoveItemToPane", 2],
            "ctrl-shift-4": ["workspace::MoveItemToPane", 3],
            "ctrl-shift-5": ["workspace::MoveItemToPane", 4],
            "ctrl-shift-6": ["workspace::MoveItemToPane", 5],
            "ctrl-shift-7": ["workspace::MoveItemToPane", 6],
            "ctrl-shift-8": ["workspace::MoveItemToPane", 7],
            "ctrl-shift-9": ["workspace::MoveItemToPane", 8]

The latter should be added to the "base_keymap": "SublimeText" defaults. May I do it in the same PR? How do those work? Just edit default-*platform*.json after the comment, right?

Should I also add vim defaults? If so, which exact?

Igonato added a commit to Igonato/zed that referenced this issue Dec 10, 2024
Closes zed-industries#20205

An action to move the active editor to a pane in a specified direction
Igonato added a commit to Igonato/zed that referenced this issue Dec 10, 2024
Closes zed-industries#20205

An action to move the active editor to a pane in a specified direction
Igonato added a commit to Igonato/zed that referenced this issue Dec 10, 2024
Closes zed-industries#20205

An action to move the active editor to a pane in a specified direction
Igonato added a commit to Igonato/zed that referenced this issue Dec 11, 2024
Closes zed-industries#20205

An action to move the active editor to a pane in a specified direction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] vim
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants